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 filter tasks with changed status?

I'm trying to get a list of tasks with a changed status. I am interested in tasks that have been completed (had Done status) and reopened again (new status - In Progress ) at some point in the past. These tasks can either be in the In progress status, or closed again. I am interested in their reopening moment, to calculate the percentage of reopened tasks.

Im using python-jira library

My filter query 

jql = 'project=' + project_key + ' AND status changed FROM "Done" TO "In Progress" '

 But the list is empty. 

If I try get smt like 

jql = 'project=' + project_key + ' AND status="Done"'

or

jql = 'project=' + project_key + ' AND status="In progress"'

 it works.

Can you help me with this task?

1 answer

1 accepted

Hey @Evgeny Lepilov ,

to me this looks fine. Maybe it's due to "In Progress" being spelled differently both times.

Does your workflow contain a transition from Done to In Progress?

Cheers,

Andrej

Hey< @Andrej_Freeze__greenique_  Thanks for your ansver.

For testing I created new jira project with several tasks  and changed the status of these tasks several times from :

To Do to In progress -> Done->In Progress->Done

Does your JQL query work if you use it within jira's issue navigator? Executing it there will likely make it easier to debug.

Maybe it is also due to the Space at the end of your first query.

But creating a query like project = EXMPL and status changed FROM "New" to "In Progress" works fine within our system.

I removed space from the end of query, but didnt help. 

Im new in jira api and didnt understand what you mean jira's issue navigator. How How can I use this?

To put it simple, do you have access to the jira instance? If so, try to paste the query you are using within your API within JIRA.

To get there within Jira Cloud, simply append "/issues/" to your url, when opening your site in a browser. This way you should receive something like "example.atlassian.net/issues/". In there, click on switch to JQL next to the Search button.

Here you can paste the JQL Query you created and check, whether it really returns nothing, of if there are any errors 😊 

I tried filtering the data with different jql requests. On old projects  can output tasks with changed status from "In progress" to "Done". But not vice versa from "Done" to "In Progress" or "To Do" to "In Progress" .Okay, here we can assume that no task has been reopened. 

Now I understand that the query syntax is written correctly.

But in a test project, an empty list is always displayed. Whatever filter I apply. Only if I do not specify a filter, I get a list of all the issues.

I do not understand what I am doing wrong. Isn't it enough to change the task status in the user interface?

It is certainly enough, but maybe there are simply no issues that match to your search criteria. Could it be that the test project does not contain any issues at all?

No, if I run

jql = 'project=' + project_key + ' AND status="Done"'
issues_list = jira.search_issues(jql, json_result=True)

for i in issues_list['issues']:
print(i['fields']['status']['name'])
print(i['fields']['updated'])

get  

  • Done
    2019-12-30T13:33:30.852+0300
    Done
    2019-12-30T13:17:29.730+0300
    Done
    2019-12-27T16:28:37.468+0300

Suggest an answer

Log in or Sign up to answer
TAGS

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