Forums

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

How to query the time since a comment was added to an issue

Chris Watson January 18, 2023

Hello,

I am trying to create an automation rule that checks the number of days since an issue was commented on/updated. It appears that the comment variables are setup to act as a trigger for the rule, rather than something that can be used for comparison.

My goal is to have a rule that will send out a notification if an issue has not had any comments added in 30+ days. I have all of the other pieces of this rule working, but I am not able to figure out how to check the comment piece. 

 

2 answers

1 accepted

2 votes
Answer accepted
Alex Koxaras _Relational_
Community Champion
January 18, 2023

Hi @Chris Watson and welcome to the community

You should create a rule like the following:

comm rule01.png

Pay attention to the checkboxes as well as on the JQL. You have to replace this with your own.

Let me know if you got this!

Chris Watson January 18, 2023

Excellent, thanks for the help.

Alex Koxaras _Relational_
Community Champion
January 18, 2023

Kindly mark my answer as accepted in order to help others with similar  questions.  Thanx!

Chris Watson January 19, 2023

It doesn't appear to be working correctly. I applied the change in syntax and when the rule ran it triggered on issues that had been updated 2 days ago.  Here is the syntax of my query. 

 

project = WMO AND status = "In Progress" OR status = "Pending Internal" OR status = "Pending Vendor" or status = "Approved" and updated <= startOfDay(-30)

Alex Koxaras _Relational_
Community Champion
January 19, 2023

@Chris Watson you have to use parenthesis in your clause for starters:

project = WMO AND (status = "In Progress" OR status = "Pending Internal" OR status = "Pending Vendor" or status = "Approved") and updated <= startOfDay(-30)

OR you can use:

project = WMO AND status in ("In Progress", "Pending Internal", "Pending Vendor", "Approved") and updated <= startOfDay(-30)

Like Juan Carlos Vera likes this
0 votes
Juan Carlos Vera
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.
January 18, 2023

You can see if there are comments added -30d with an alias that is part of a Plugin "JQL Search Extensions for Jira - the JQL extensions"

You can find issues that were recently commented on and order them by the comment date:

commentLastUpdatedOnDate < -2d order by commentLastUpdatedOnDate desc

I think that is free for 10 users.

You can see more info here:

JQL aliases and functions (reference) - JQL Search Extensions - Confluence (atlassian.net)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events