Skip to content

Commit ff593ed

Browse files
authored
function to get the build statuses (#455)
Added function to get the build statuses associated with a commit.
1 parent c9f6a14 commit ff593ed

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

atlassian/bitbucket.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,3 +2170,18 @@ def delete_repo_condition(self, project_key, repo_key, id_condition):
21702170
repoKey=repo_key,
21712171
idCondition=id_condition)
21722172
return self.delete(url) or {}
2173+
2174+
def get_associated_build_statuses(self,commit):
2175+
"""
2176+
To get the build statuses associated with a commit.
2177+
:commit: str- commit id
2178+
:return:
2179+
"""
2180+
if not self.cloud:
2181+
url = '/rest/build-status/1.0/commits/{commitId}'.format(commitId=commit)
2182+
else:
2183+
url = '/rest/build-status/2.0/commits/{commitId}'.format(commitId=commit)
2184+
2185+
return self.get(url)
2186+
2187+

0 commit comments

Comments
 (0)