How do I filter tasks with changed status?

Evgeny Lepilov December 30, 2019

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

0 votes
Answer accepted
Andrej Freeze _ greenique
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 30, 2019

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

Evgeny Lepilov December 30, 2019

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

Andrej Freeze _ greenique
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 30, 2019

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.

Evgeny Lepilov December 30, 2019

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?

Andrej Freeze _ greenique
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 30, 2019

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 😊 

Evgeny Lepilov December 30, 2019

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?

Andrej Freeze _ greenique
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 30, 2019

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?

Evgeny Lepilov December 30, 2019

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