I’m having trouble with a JQL query. I’m trying to setup a Confluence page to return issues that were completed in the last month (which I’m willing to define as 30 days since it doesn’t seem like JQL has a months capability). To that end, my JQL statement is:
project="XX" AND status CHANGED TO "Done" AFTER -30d
but this consistently returns zero results, even though I have an issue that qualifies. If I remove the TO criterion like this:
project="XX" AND status CHANGED AFTER -30d
it seems to work. If I try:
project="XX" AND status CHANGED TO "Done"
it also fails to return any results. Oddly enough, that last queries fails to return any results for any status other than "To Do", and even that one only returns my Epics for some odd reason. What am I doing wrong?
Note that this is a next-gen Jira project, if that matters.
Welcome to the Community!
Jira does use months, but only in terms of this month, or last month, etc.
Can you try the below and see if it is what you need?
project = XX AND resolution date >= startofMonth ("-1") AND resolution date <= endofMonth ("-1")
This should show all tickets resolved in October.
Thanks @Liam Green ! I was able to get it to work by slightly modifying it (since I wanted the changes to be for November instead of October, although when I generate the report will obviously impact that...) to
project = "XX" AND resolutiondate >= startofMonth () AND resolutiondate <= endofMonth ()
But of course the downside here is it only works for resolved issues and doesn't explain the larger issue of why I can't do this with statuses alone (even if Done + resolved were some unique status, which I don't think it is, it should be able to work for ones that changed to "In Progress" for example).
No, it doesn't work - I wasn't trying in Next Gen before.
It seems as though it is a known bug in Jira. There is a page for it:
The page does have a workaround on it too. There is also a workaround trick on this question: https://community.atlassian.com/t5/Jira-Software-questions/BUG-JQL-Unable-to-query-next-gen-project-s-issues-with-status/qaq-p/1319216 which has been said to work.
Hopefully Jira will resolve it at some point soon
Thanks for the link to the bug issue and workarounds! I definitely missed those. Very sad to see that it is an ongoing problem that seems to remain unresolved (and at least one person reports the workaround as not being reliable either). Using the numeric ID of the status is the trick it seems.
Also, looking at the numeric status workaround (the second link you give above) makes it seem pretty clear what's happening on the backend: Jira treats Done for classic projects as a status with a different ID than Done in next-gen projects. What a strange choice (and seemingly something that would be relatively easy to fix simply by changing Done to Complete by default or some such)
Indeed, this is weird because this should work (I does work in my instance).
Are you sure that "Done" is the right status name ? Which statuses does Jira propose when you're building your search ? If it is the right status name, I suggest you to raise an issue from the Atlassian support portal (Suggestion and bug reports) :
@Guilhem Dupuy Disturbingly, I can only submit a proper bug report if I pay for Jira. As I'm currently testing it out for a small team with a free account, I can't file the bug. Super odd approach, Jira.
I did manage to find my way on to the engineers' Jira board for Jira (super meta!) and seem able to submit a bug that way, but I don't know if they'll see it...
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