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 do I get the date of the task status change and its timespent?

Edited

I'm looking for a way to keep track of the time spent on Reopened tasks beyond the expected value. Im using python-jira library. As a result  I want to get the date of the status change and the amount of time that will be spent on her decision.

I've already written some code, but I haven't gotten the result.

def get_issues_from_task(username=None, token=None, project_key=None):
jira = JIRA(basic_auth=(username, token), options={'server': SERVER})
jql = 'project=' + project_key + ' AND status changed FROM Closed TO Reopened'
issues_list = jira.search_issues(jql, json_result=True) #get the issues list

for i in issues_list['issues']:
isssues_key = i['key']
issue = jira.issue(res, expand='changelog')
changelog = issue.changelog
for history in changelog.histories:
for item in history.items:
if item.field == 'status':
# here I need to get the date of the status change to Reopened and the new time it takes to do it.

return data

Tell me please how I can finish this code or redo it.

1 answer

1 accepted

1 vote
Answer accepted

Hello,

Take a look at the @Chris Young4 answer in this thread. It is a good point to start. You will need to create a loop and make some calculation to achieve what you want.

https://community.atlassian.com/t5/Jira-questions/Is-it-possible-to-get-the-issue-history-using-the-REST-API/qaq-p/510094

 

Hope this helps

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

New page sharing experience, coming soon to Confluence Cloud

...eans the lock icon is going away, you’ll find all of the lock icon’s functionality in the new Share button.  More visibility into a page’s true access No more uncertainty around w...

31 views 0 4
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