Could you help me to find a right JQL expression:
I want to find issues that changed status more then 7 days ago. I use the next JQL:
...status in ("X") AND status changed to "X" before startOfDay(-7)
But there is one problem: a status can be changed some times but I need just last change.
But this JQL does not consider this condition and returns issues that changed status yesterday (because the first change was 1 month ago, for example).
What the condition help to find only last changes of status?
I got the same problem. Let's think logically ;) We need to catch issues which changed status to "X" before and did not changed it AFTER. So let's play with logic BEFORE and AFTER:
...AND status changed to "X" before startOfDay(-7) AND NOT status CHANGED TO "X" AFTER startOfDay(-6)
Related
We're using Slack and JIRA together and we want to create one webhook for every of our users. If any user A makes a change in user B's issues, user A should be notified via Slack. But if user A makes a change in user A's issues, user A should NOT get a notification in slack.
We tried the following JQL statement for the user "max":
project = "Project Name" AND assignee="max" AND NOT status changed AFTER "-2m" by "max"
Unfortunately it does not work.
If Max makes a change to his issues, he gets a notification in Slack, but if he changes the same issue again afterwards, he does not. It seems like the "status change by" is not set at the time the webhook is triggered, but only afterwards.
Is there some kind of field for the User who triggered the webhook? That is essentially what we need.
EDIT:
More info: We're using this Slack integration and combining it with the webhook:
https://marketplace.atlassian.com/plugins/eu.wisoft.slack.jira/cloud/overview
I created an additional "all Jira notifications"-configuration with this Slack-plugin and it works quite fine. Hence, the slack plugin does work fine, but my JQL filtering is the issue apparently.
Last try:
project = "Project Name"
AND assignee="max"
AND status changed AFTER -2m
AND NOT status changed by "max" AFTER -2m
Using this from a comment, I was able to get it to work inconsistently:
A new jira-issue that I put on Todo with "max" and assignee "max", that is moved by another user to "Progress" (hence status-change), does not cause the webhook to trigger. The next time, the same user changes this issue from progress to todo or back, the webhook is triggered. It feels like at the time of the webhook call, the latest information is not available. It feels like at the time of the first change, this part fails:
AND status changed AFTER -2m
How could I fix this?
I think the JQL you're looking for is this:
project = "Project Name"
AND assignee="max"
AND status changed AFTER -2m
AND NOT status changed BY "max" AFTER -2m
This is telling JIRA:
Give me everything in project-name;
That is owned by max;
Limit it to anything where the last status change was after 2 minutes ago
Further limit it so that the last status change was NOT done by max in the last 2 minutes
I need a JQL query, that shows me all issues, that have been worked in since X hours.
I can find in JIRA, to get all resolved issues in the last X hours resolved >= '-1h' or created created >= '-1h', but don't find any to get those, that have been started to work on.
So there is the status field, that switches from "OPEN" to "IN PROGRESS", which is the progress I'm interested in.
I tried updated >= '-1h' AND status in('IN PROGRESS') AND status was in('OPEN'), but the status was does not take the updated into account, which means, I do also get an issue back, that has been updated with something in the last hour, but the status change was done way longer ago.
So how can I get the issues, that had the status change in the last X hours ?
You're looking for the CHANGED operator. Its documentation is available here.
You can use a query like:
status changed TO "In Progress" AFTER -4h
I want to show all issues where it has been in a current status for more than X days - is this possible?
We have this workflow: Registered => Analyze => Planned ... etc. The ticket can be in Registered for 3 weeks and it can be 3 weeks in Analyze without any problems.
Currently I am using this JQL to show tickets that have been more than 3 weeks in Analyze:
project = MyProject AND status = Analyze AND created <= -6w
This is wrong due to so many reasons and it does not look at the time in the current transition state - nor does it take in to account that it can be pushed back from Planned to Analyze and then allow a new 3 weeks analyze period.
Is the above possible to filter in JIRA? I don't have the possibility to use the JIRA REST interface - only the builtin JQL.
I am running with JIRA version 6.4.5.
You should be able to get there using the JQL CHANGED operator. Its documentation is available here.
Your query would look something like this:
project = MyProject AND status = Analyze AND status CHANGED BEFORE -3w
If you want to know for what day range the issue was lying in a status and when status are consecutive, for example a UX review will happen before QA starts working on it and I want to know the issues which are lying in UX review for more than10 days then my JQL can be
project = *your project* AND status changed to "Ux review" before startOfDay(-10) AND status changed from "UX Review" to "Ready to test" after startOfDay()
project = MyProject AND status = Analyze and not status changed during (-xd,now())
With Script Runner plugin I'd create a new scripted field that would just return the number of days since the last status change, with a Number field template, and Number Range Searcher. The
def items = com.atlassian.jira.component.ComponentAccessor.changeHistoryManager.getAllChangeItems(issue).findAll{it.field=="status"}
will return ChangeHistoryItems for Status field. Take the last one and use its getCreated() to find Timestamp. If the list is empty, it means that the issue is in the first step of the workflow, use its issue.getCreated(). Test. Re-index. Search. Use.
I want to find all the issues which changed the status during last one hour. I can get the list of issues updated in last one hour by using
updated >=-1h
but this also give issues which are updated but status not changed.
You may try the following query:
updated >= -1h and status CHANGED
Reference: https://confluence.atlassian.com/display/JIRA061/Advanced+Searching
I need to filter on tickets that went into status a status of RTT after a particular date. These tickets would be resolved now but I need to see all those that entered that status after a date regardless of their current status.
for example, find all issues that their status changed from Open to Closed after 2012/12/31:
status CHANGED FROM "Open" TO "Closed" AFTER "2012/12/31"
you can find for info about CHANGED search key on Atlasian's Advanced Searching page.
type = "Bug" AND status was in ("Resolved")