How to update JIRA status by filtering issues using a label

nina January 21, 2019

Hi,

I am new to using JIRA REST API. I have a requirement where i should update JIRA status field by filtering  issues using label.should i use curl or jql query? 

 

Thanks!

2 answers

0 votes
nina January 22, 2019

Thank You! I'm trying below :

curl -D- -u  user:Password X GET -H "Content-Type: application/json" https://jirapro.***.com/rest/api/2/search?jql=project+order+by+labels=Pending&startAt=1&maxResults=2" . . But i don't see any results .

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2019

Hello,

You first need to find all issues by a JQL query like this:

label = "your label"

You can find all issues with the search rest endpoint:

https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/#api/2/search-search

Then you can update statuses of such issues with  this rest api endpoint:

https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/#api/2/issue-doTransition

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2019

you curl statement should look like this:

curl -D- -u  user:Password X GET -H "Content-Type: application/json" https://jirapro.***.com/rest/api/2/search?jql=labels=Pending&startAt=1&maxResults=2

nina January 22, 2019

Thank You! i was able to get the list of issues .

nina January 22, 2019

how can i  change the status from the results ,the results displays all the fields of the issues.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2019

Suggest an answer

Log in or Sign up to answer