Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically check if a ticket is in a "closed" or "open" state?

emanoel.moraes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 12, 2023

At the company I work we have many issue types and every issue type has different states, but all of the issue types have final states (closed). I would like to know if there is an endpoint that I can use to check if a ticket is in a closed or open state.

2 answers

0 votes
Aron Gombas _Midori_
Community Champion
September 13, 2023

Get the issue with a call to

https://foobar.atlassian.net/rest/api/2/issue/FOO-123

and check the "statusCategory" embedded object:


"status": {
"self": "https://foobar.atlassian.net/rest/api/2/status/10049",
"description": "",
"iconUrl": "https://foobar.atlassian.net/",
"name": "Done",
"id": "10049",
"statusCategory": {
"self": "https://midori-global.atlassian.net/rest/api/2/statuscategory/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
// ...
0 votes
Sayed Bares [ServiceRocket]
Community Champion
September 12, 2023

@emanoel.moraes welcome to the Atlassian community!

You will need to use Get issue endpoint.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events