diff --git a/jenkinsapi/build.py b/jenkinsapi/build.py index 5e8d97e0..42165273 100644 --- a/jenkinsapi/build.py +++ b/jenkinsapi/build.py @@ -149,8 +149,11 @@ def get_changeset_items(self): if "items" in self._data["changeSet"]: return self._data["changeSet"]["items"] elif "changeSets" in self._data: - if "items" in self._data["changeSets"]: - return self._data["changeSets"]["items"] + changes = [] + for change in self._data["changeSets"]: + if "items" in change: + changes += change["items"] + return changes return [] def _get_vcs(self) -> str: diff --git a/jenkinsapi_tests/unittests/configs.py b/jenkinsapi_tests/unittests/configs.py index 9f604770..7698bca9 100644 --- a/jenkinsapi_tests/unittests/configs.py +++ b/jenkinsapi_tests/unittests/configs.py @@ -168,27 +168,32 @@ "artifacts": [], "building": False, "builtOn": "localhost", - "changeSets": { - "items": [ - { - "affectedPaths": ["content/rcm/v00-rcm-xccdf.xml"], - "author": { - "absoluteUrl": "http://jenkins_url/user/username79", - "fullName": "username", - }, - "commitId": "3097", - "timestamp": 1414398423091, - "date": "2014-10-27T08:27:03.091288Z", - "msg": "commit message", - "paths": [ - {"editType": "edit", "file": "/some/path/of/changed_file"} - ], - "revision": 3097, - "user": "username", - } - ], - "kind": None, - }, + "changeSets": [ + { + "items": [ + { + "affectedPaths": ["content/rcm/v00-rcm-xccdf.xml"], + "author": { + "absoluteUrl": "http://jenkins_url/user/username79", + "fullName": "username", + }, + "commitId": "3097", + "timestamp": 1414398423091, + "date": "2014-10-27T08:27:03.091288Z", + "msg": "commit message", + "paths": [ + { + "editType": "edit", + "file": "/some/path/of/changed_file", + } + ], + "revision": 3097, + "user": "username", + } + ], + "kind": None, + } + ], "culprits": [], "description": "Best build ever!", "duration": 5782,