Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,361,397
Community Members
 
Community Events
168
Community Groups

Ticket search for recent ticket comments (JQL)

I am trying to do search for tickets that have not been commented on in the current month. I managed the JQL for that. The challenge is I need to do the search, ignoring any comment from a certain user (management aka "UserA").  So a ticket might have 2 comments, the last comment by "UserA" and previous to that from someone else, I would like to ignore the "UserA" comment and and determine if the previous comment was made before the current month.

I do not have any additional JQL plugins from the marketplace.

Here is my current JQL I have been working on:

 PROJECT = "MyProject" and  ( issueFunction not in commented("by UserA")  and (issueFunction in lastComment('before startOfMonth()' ) )

Any suggestions would be welcome. I am not sure this can be done.

2 answers

2 accepted

0 votes
Answer accepted

Thank you for your help and suggestion to contact Scriptrunner. Here is the final JQL:

issueFunction not in commented("by UserA") AND issueFunction in lastComment("before -4W") AND project = "MyProject "

@Bill Parlock -

I am glad that my suggestion helped you at the end.  Please also click on Answer accepted on my original postings when you have a chance.

Best, Joseph

0 votes
Answer accepted

@Bill Parlock -

It looks like you are using ScriptRunner for Jira.  Take a look at the at this vendor link which I am sure you already did - https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/comments

Try something like -

project = MyProject and issueFunction not in commented("after -4w by UserA")

This should give you the result of finding issues commented not by UserA within the last 4 weeks.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

Thank you. I will give it a try.

@Bill Parlock -

Keep me posted of your testing result.  If my suggestion helped you, please click on Accept answer when you have a chance.

Best, Joseph

The results will give me any issues not commented by UserA in the last 4 weeks. This is part of what I am looking for. So in addition, I am looking for issues with no comments for the last 4 weeks. So basically I am looking to exclude any comments by UserA, and then determine the tickets that have not been commented on in the last 4 weeks.

@Bill Parlock -

The following JQL may work for you -

project = MyProject AND issueFunction not in commented("after -4w by UserA") AND issueFunction in hasComments(0)

Hope this helps.

Best, Joseph

So I have been working with this suggestion. As written, this will only return tickets that have never been commented on. I am looking for tickets that have not been commented on in the last month. I am continuing to work with the JQL (changing slightly what I am looking for , to make testing easier. ie. return tickets with multiple comments, but not from UserA). But it seems I can only get the first AND statement working because once the comment from UserA is ignored, any other comments on that ticket are also ignored) . So if I have a comment from UserA, and a comment from myself 'Bill' on the same ticket, then my comment is not recognized. 

Thank you for your assistance.

@Bill Parlock -

Can you share with me your latest JQL?

Another suggestion for you is for you to contact Scriptrunner for Jira vender (Adaptavist) for further suggestion.  I know that in the past, they are extremely responsive and provide possible solution as long as you give them exactly what you want to achieve. 

Please share with me of their suggestion if you can.

Best, Joseph 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13.18
TAGS
Community showcase
Published in Jira Service Management

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the webResponse.body.data.first s...

714 views 3 20
Read article

Atlassian Community Events