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 get time an issue has been in status using REST?

rich leblanc Feb 27, 2014

I need to find issues that have been in a status for longer than a certain time period, say a month using the REST API and python. How would I get that information? Is there a field that contains the time a status was entered? In other words, how can I tell how long an issue has been in a state?

3 answers

0 votes
Gregory Sudderth Feb 27, 2014

I would write a small python program, that would hit the server and get all the issues that match the basic JQL (for that project, in that status etc.) and then iterate through the results and look at the timestamps. I've done that very thing and its not hard. I guess I should put some source up on github?

I can either anonymize the program or just post a snippet. Up to you.

0 votes
rich leblanc Feb 27, 2014

"...iterate through the results and look at the timestamps". How? I've got the issues just don't see any timestamp on the status. Don't need to put code on github just what's the query to see the timestamps?

0 votes
Gregory Sudderth Feb 27, 2014

The Status looks like a varchar and looks like it doesn't have its own time stamp as per: https://developer.atlassian.com/display/JIRADEV/Issue+fields

"Updated" means a lot of things...but I would guess looking at the history for the issue would be the trick. That leads us to:

https://answers.atlassian.com/questions/64708/is-it-possible-to-get-the-issue-history-using-the-rest-api....The entry by Chris Young looks like the weiner! Good luck.

Gregory Sudderth Mar 05, 2014

Did that last link work for you?

rich leblanc Mar 05, 2014

No, I don't understand. I put ?expand=changelog in my request with and without the question mark in front but don't see anything different in the response.

r = requests.get('http://jira.xxxxxxxx.com/rest/api/2/search?jql=%s&startAt=%s&?expand=changelog' % (jql, start_issue), auth=('user', 'password'))

print r.json()

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

1,096 views 13 15
Read article

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