Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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 

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
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,917 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you