The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get JIRA ticket url from Bitbucket Pull Request

Anil Mishra
Contributor
October 22, 2023

I'm writing a plugin and wanted to pull all Jira ticket along with their url (multiple Jira instance are linked to my bitbucket data center). and export it

Currently I'm calling pull request api is which is returning internal url which can be resolved from browser but I'm looking for exact url or way to get Jira ticket url out of it.

 

https:/bitbucket-host/bitbucket/rest/jira/latest/projects/JIR/repos/icgjira/pull-requests/30/issues
This just returning 
[
    {
        "key""BOP-967",
    },
    {
        "key""C1311-9",
    }
]
here both url belong to different Jira instance and I don't see any way to get Jira url for issue.
Please help.
Thanks,
Anil

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Anil Mishra
Contributor
October 24, 2023

I see some workaround by calling below bitbucket rest api

/rest/jira-integration/latest/issues?issueKey=C1311-9&fields=url

"url":"https:\/\jira.atlassian.com/\/jira\/browse\/C1311-9"

Read url value from the response json, it will give Jira URL for provided ticket.

 

If anyone have more simpler solution or using Java API, kindly suggest.

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events