Query JIRA to get FIX versions for the given JIRA issues

Theresa Winnarasi July 30, 2015
Hi,
I have a JIRA.txt file like this.
Issue:
INF-124 
INF-742 
INF-998 
INF-362
  How can I get the "Fix Version/s" of those Issues only? I am supposed to create a Bamboo plan which when runs, takes this JIRA.txt as input and gives output as below.
Issue Fix Version
INF-124 PRJ 7.1 
INF-742 APP 5.2 
INF-998 PRJ 7.1 
INF-362 APP 5.2
I havent worked on REST APIs. Could you help me how to do this please? 

2 answers

1 accepted

0 votes
Answer accepted
João Palharini
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 30, 2015

Hi Theresa!

You can use the GET method of REST on the URL below. Just use any text manipulation function to insert the issue key you need instead of <issue-key>.

http://&lt;jira-base-url&gt;/rest/api/2/issue/&lt;issue-key&gt;?fields=fixVersions

Then it will return a JSON-formatted output similar to the one below:

{"expand":"renderedFields,names,schema,transitions,operations,editmeta,changelog","id":"11604","self":"http://localhost:8646/jira646/rest/api/2/issue/11604","key":"AP-13","fields":{"fixVersions":[{"self":"http://localhost:8646/jira646/rest/api/2/version/10101","id":"10101","name":"1.3","archived":false,"released":false}]}}

The name of the version will be returned by the "name" property (in the example, the version is 1.3) and the issue key will be returned by the "key" property (in the example, it's AP-13).

--
Cheers!

Joao

0 votes
Theresa Winnarasi July 30, 2015

Sweet. That works great. Thank you so much. 

Suggest an answer

Log in or Sign up to answer