How do I transition an issue to a Closed state via the Jira API?

Joe Osborne July 8, 2021

I am attempting to close Jira issues via REST API, however, I am getting a 500 error when attempting to POST to the transitions API endpoint.

I am submitting the following as JSON:

closeIssue = {
"transition":{
"id": "6"
}
}

Each submission results in the following error:

{"errorMessages":["Internal server error"],"errors":{}}

 

 

When I attempt to GET the transitions endpoint, I get the following response:

{"expand":"transitions","transitions":[]}

 

I think I should be seeing possible transitions with the GET action, but I don't see anything.

3 answers

1 accepted

1 vote
Answer accepted
Joe Osborne July 12, 2021

Thank you all.  We found that the issue was permissions related.  The user I was using for REST work did not have permissions to perform transitions.  

We altered this and gave the user transitions and I can see the available transitions in the GET call now.  

1 vote
KellyW
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 9, 2021

With GET /rest/api/2/issue/{{issueId}}/transition, we can identify the transition ID to resolve the issue.

Then I issue POST /rest/api/2/issue/{{issueId}}/transitions with following JSON to resolve the issue:

{

"transition": {

"id": "761"

}

}

I got the internal server error if the transition ID isn't a valid transition for the issue.

Example: I was closing issue# ABC-1 with transition ID 761 but got the error doing the same for issue# ABC-2 as it was with different issue type that associated with different workflow.

Joe Osborne July 9, 2021

Unfortunately, nothing comes back with a GET request.  I get a blank response:

{"expand":"transitions","transitions":[]}

Any idea what could be causing this?   

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2021

Something on your workflow must hide the transition so the API is returning an empty array

KellyW
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 11, 2021

Workflow condition and user permission can result in empty transition.

For example, if you have the workflow condition that only allow Assignee to transition issue, then user other than the Assignee will not be able to see any transition option.

If this is a Jira Service Management issue and user (not the issue Reporter) has no JSM application access, the transition option will not be available for this user.

The easiest approach to clarify this is to login to Jira application as the user associated to the REST call and confirm if the user can see the transition option.

Like marcazeballosh likes this
0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2021

Can you check if you don't have a condition in your workflow that hide the transition

Suggest an answer

Log in or Sign up to answer