Retrieve jira ticket using bitbucket cloud commit

Jayaraj Wilson November 14, 2019

My bitbucket cloud is integrated with jira.

From a historic and perhaps future release perspective, I have a set of commit ids that fall into a release.

I would like to programatically or using an api  find out which jira ticket the commit corresponds to and then perhaps apply a label or fixversion to the same. I almost have a go code for the second part, but not sure of the first part

1 answer

1 vote
StannousBaratheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 14, 2019

Hi @Jayaraj Wilson 

I assume you're already referencing your Jira issues in the commit messages as documented here: https://confluence.atlassian.com/jirasoftwarecloud/referencing-issues-in-your-development-work-777002789.html

Unfortunately there currently isn't a public API to retrieve that association but you can parse the issue key out of the commit message (e.g. using regex) and look it up using Jira's public API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issue-issueIdOrKey-get

Jayaraj Wilson November 17, 2019

Thanks for the prompt response. This did come in handy.

But I only wish there was api to help with the same to make things easier.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events