Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Slack notification for tickets in a status for more than X time

Sam Nicholls August 5, 2024

I'm trying to set up an automation via Jira rule builder. The requirements are: if a ticket has been in the 'in review' or 'code review' status for more than 2 days, then I want to send a notification to the Slack channel for the relevant team (this is only for issues on their Jira project). 

However I must have an issue with my JQL because currently all tickets that are in code review or in review are coming through with the notification, regardless of how long they've been in code review / in review.  

When I test my JQL in the rule builder, it looks correct (see screenshot below - currently 0 issues found). So i'm not sure why it's then pulling through tickets incorrectly to Slack. 

The JQL i'm using is: project = "Project Name" AND statusCategoryChangedDate >= 2d AND status = "IN REVIEW" OR status = "Code review"

Does anyone have any ideas I could try to fix this? 

Screenshot 2024-08-05 at 14.14.44.pngScreenshot 2024-08-05 at 14.08.42.png

2 answers

0 votes
Ponnappan Ganapathiya
Contributor
August 5, 2024

I suspect with OR status = "Code Review" . if I am not wrong it is pulling all status in Code Review irrespective of the remaining JQL.

 project = "Project Name" AND statusCategoryChangedDate >= 2d AND (status = "IN REVIEW" OR status = "Code review")

Moreover, use Status in ("In Review","Code Review") instead of using OR to avoid such confusions.

Sam Nicholls August 5, 2024

I will try that, thank you!! 

Ponnappan Ganapathiya
Contributor
August 5, 2024

also try NOT status changed after startOfDay(-2d) instead of statusCategoryChangedDate >= 2d

0 votes
Aaron Pavez _ServiceRocket_
Community Champion
August 5, 2024

Hi @Sam Nicholls 

Could it be a problem with the automation? The AND will run regardless of the THEN result.

You need an IF.

Can you send us a screenshot of the Slack message you are getting? is the result of the JQL?

Regards

Aaron

 

Sam Nicholls August 5, 2024

Hi @Aaron Pavez _ServiceRocket_

Thanks for your message! The issue is that the Slack message is sending through ALL tickets that are in either the 'code review' status or the 'in review' status on the project regardless of the length of time they've been in that status - i.e. whether they've been in there 3 days or 3 hours.

It seems to be ignoring the StatusCategoryChangedDate part of the query 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events