From fc888797eb8d69c73a4b9463fd7206bcf25982ae Mon Sep 17 00:00:00 2001 From: samantaamit <61245830+samantaamit@users.noreply.github.com> Date: Thu, 20 Feb 2020 01:03:36 +0530 Subject: [PATCH] function to get the build statuses Added function to get the build statuses associated with a commit. --- atlassian/bitbucket.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/atlassian/bitbucket.py b/atlassian/bitbucket.py index 8467d7d57..a5197f572 100644 --- a/atlassian/bitbucket.py +++ b/atlassian/bitbucket.py @@ -2170,3 +2170,18 @@ def delete_repo_condition(self, project_key, repo_key, id_condition): repoKey=repo_key, idCondition=id_condition) return self.delete(url) or {} + + def get_associated_build_statuses(self,commit): + """ + To get the build statuses associated with a commit. + :commit: str- commit id + :return: + """ + if not self.cloud: + url = '/rest/build-status/1.0/commits/{commitId}'.format(commitId=commit) + else: + url = '/rest/build-status/2.0/commits/{commitId}'.format(commitId=commit) + + return self.get(url) + +