I wanted to extract all backlogs related to a particular project. I read one of the queries related to this and came up with something like this :
project = *project_name* AND issuetype in (Task, Bug, Improvement, "New Feature", Enhancement) AND sprint is EMPTY AND resolution = Unresolved and status != Closed
But this doesn't seem to be working.
Can someone help me out with how all backlogs can be extracted?
Hi @Pranay Verma,
If I got you correctly, you may not get the exact count shows in the backlog as your result
it's because any tickets moved from sprint to backlog during sprint closing then the sprint field is not empty on those tickets.
I hope below query may help you to fetch your backlog tickets
project = *project_name* AND issuetype in (Task, Bug, Improvement, "New Feature", Enhancement) AND (sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) AND resolution = Unresolved and status != Closed
Regards,
Leo
Hi @Leo This query is partially working for me. Thanks a lot!!!! The only thing is I'm trying to do this using Python.
I've tried something like this:
issues_in_backlog = jira.search_issues('project = \"AM+ Assets Delivery\"' AND issuetype in (Task, Bug) AND (Sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) AND resolution = Unresolved AND status != Closed)
But this is giving a syntax error, that I tried in both the code as well as the Advanced Search textbox. Could you help me with the syntax? Then I could probably filter my query, that'll provide me with all the relevant backlogs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pranay Verma,
I don't find any issue with query and I'm not familiar with python. if you could attach the screen shot of advance search error. I may get something to suggest
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Leo ,
Earlier, I'd run this query for getting all the issues in the project, and this worked perfectly for me. I'm pasting the query so you could use it for your reference.
issues_in_project = jira.search_issues('project = \"One+ Dev Proj\"', startAt=0, maxResults=1000,validate_query=True,fields=None,expand=None,json_result=None)
So, the only difference that should happen here will be in the JQL, since it'll be refined only for getting the backlogs.
I've attached the Advanced Search box screenshot, where I'm getting the Syntax Error, for the Backlog Query.
Could you please have a look at this query, and point out where I'm going wrong.
Thanks,
Pranay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pranay Verma,
I don't think the way you put your query in advance search will work, as you are invoking python code there, I'll attach both screen shots from my window where python code will throw error and only the JQL query will succeed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Leo ,
Yes I'm aware that the below one won't succeed in this window. I was successfully able to run the JQL in the advanced search box. I just wanted to point out the previous python code and the new one, so that you could compare and point out to a potential syntax error, since as I earlier mentioned the only difference in the jira.search_issues() method would be only in the JQL.
Could you help me with the syntax if possible?
Thanks,
Pranay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pranay Verma,
I'm not familiar with python code but below syntax may work for you, if my assumption is right from Project till status should be covered with single quotes(''). and the others are parameters like startAt,etc.. so no need to be covered by quotes
issues_in_backlog = jira.search_issues('project = \"AM+ Assets Delivery\" AND issuetype in (Task, Bug) AND (Sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) AND resolution = Unresolved AND status != Closed', startAt=0, maxResults=1000,validate_query=True,fields=None,expand=None,json_result=None)
Regards,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Leo ,
You're a lifesaver!!!!!This did the trick!!!! Thanks for the help !!!!!!
Thanks And Regards,
Pranay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From the answer above, it had some errors for jira online.
project = *project_name* AND issuetype in (Task, Bug, Improvement, "New Feature", Enhancement) AND (sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) AND resolution = Unresolved and status != Closed
The JQL below worked to show the tickets in the backlog.
project = *project_name* AND issuetype in (Task, Bug, Story) AND (sprint is EMPTY OR Sprint not in (openSprints(), futureSprints())) AND resolution = Unresolved and status != Done ORDER BY rank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to show all backlog items then please only use the following query it will show all backlog items.
project = *project_name*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Muhammad Ramzan(Atlassian Certified Master)
I'm afraid this along with the backlogs will also give the ones which aren't in backlogs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pranay Verma ,
What do you mean by not working. It is not returning all the tickets or returning more ticket. can you give more details..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and...
What is the problem you are trying to solve with this query? Knowing that will help the community better answer your question.
Thanks, and best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy So basically, I wanted to retrieve all the backlogs that are present in a particular project, be it a part of a sprint or not, just all the backlogs. You can just ignore the query that I'd created, and help me with a fresh query.
Thanks,
Pranay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank your for clarifying your goal.
How about this idea: make a simple Kanban board, with columns showing any of the relevant status values for Todo (e.g. backlog), In progress, and Done. Then make a filter including the projects, status values, etc. that you are interested in.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.