How to close sub-task tickets via JIRA REST API?

李冲 August 29, 2018

I have one requirement to close all the unclosed tickets under one project.  After checking JIRA API document,  I found that I can use below API to implement this request.

/rest/api/2/issue/${JIRA_KEY}/transitions/?expand=transitions.fields

This solution works fine for most of the cases. But when it came to sub-task ticket, it didn't work fine.

Suppose I have a `Resolved` sub-task ticket and call above API,  I will get `Reopen Issue` transition back. Below is a sample response. It doesn't return `Close Issue` transition back like other Issue Type `Bug` or `Support Request` does.

{
"expand": "transitions",
"transitions": [
{
"id": "3",
"name": "Reopen Issue",
},
"fields": {

}
]
}

 

If then, how can I close the sub-task JIRA ticket? Can someone give me some suggestion? Thanks a lot!

1 answer

0 votes
Pedro Felgueiras
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.
August 29, 2018

Hi @李冲

 

 

You may check if  you have any mandatory field in the transition. In that case you have to send that fields 

 

Best regards, 

Pedro Felgueiras 

李冲 September 2, 2018

I found the reason now. It is because the account i use only has read access. Thanks for your help. :)

Suggest an answer

Log in or Sign up to answer