Forums

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

How do I write JQL to find issues that have not been commented on past 2 days and longer

Sierra
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.
February 28, 2023

Uses Jira Cloud, have app called Adaptavist ScriptRunner for Jira Cloud so I can use CommentedOn. 

"Request Type" in ("Request Computer Support (SL)", "Network Support (SL)", "Report Desk Phone Issue (SL)", "Request Account Change (SL)") AND status not in (Resolved, Cancelled) AND commentedOn

I need to add onto this so that it only pulls these issues that have not been commented on in 2 days and longer.

 

I tried:

"Request Type" in ("Request Computer Support (SL)", "Network Support (SL)", "Report Desk Phone Issue (SL)", "Request Account Change (SL)") AND status not in (Resolved, Cancelled) AND commentedON != -2d

and many other variations and it's pulling issues that have had comments in the past 2 days.

Example.png

2 answers

1 accepted

2 votes
Answer accepted
Tuncay Senturk _Snapbytes_
Community Champion
February 28, 2023

Hi @Sierra 

If you have ScriptRunner then you can use lastCommentedDate.

 

AND lastCommentedDate <= startOfDay(-2)

AND lastCommentedDate <= -2d 

Sierra
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.
March 1, 2023

"Request Type" in ("Request Computer Support (SL)", "Network Support (SL)", "Report Desk Phone Issue (SL)", "Request Account Change (SL)") AND status not in (Resolved, Cancelled) AND lastCommentedDate >= startOfDay(-2) 

Used this ^ one of the tickets does have a comment made yesterday ^ thoughts? @Tuncay Senturk _Snapbytes_ 

Sierra
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.
March 2, 2023

Should this JQL statement be giving me the results I'm looking for? @Tuncay Senturk _Snapbytes_ 

I want to see tickets that do not have comments on them for the past two days - or longer.

"Request Type" IN ("Request Computer Support (SL)", "Network Support (SL)", "Report Desk Phone Issue (SL)", "Request Account Change (SL)") AND status NOT IN (Resolved, Cancelled) AND lastCommentedDate >= startOfDay(-2)

^ This is giving me results that do have comments yesterday and the previous day.

Query.png

Tuncay Senturk _Snapbytes_
Community Champion
March 2, 2023

Ah sorry, it should be <= 

I am correcting the answer

Like Sierra likes this
Sierra
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.
March 2, 2023

Thank you yes my results look good now. 

Tuncay Senturk _Snapbytes_
Community Champion
March 2, 2023

Pleasure!

1 vote
Hannes Obweger - JXL for Jira
Atlassian Partner
March 1, 2023

Hi Sierra,

I understand that you're using ScriptRunner, but just to put this out there: If you're open to other solutions from the Atlassian Marketplace, this would be easy to do with the app that my team is working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of so-called "smart columns" that aren’t natively available, including time since last comment, and many other comment-related fields.

This is how it looks in action:

time-since-last-comment.gif

As you can see above, you can easily sort and filter by the time since last comment, and also view it in different formats (like number of days, or number of hours). Once you've narrowed down your list of issues, you can work on your issues directly in JXL, trigger various operations in Jira, or export your issues with just one click.

You can also use time since last comment across JXL's many advanced features, such as support for configurable issue hierarchies, issue grouping, sum-ups, or conditional formatting.

Hope this helps,

Best,

Hannes

Suggest an answer

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

Atlassian Community Events