Need help with a JQL query

Ryan Wolfe
Contributor
November 27, 2024

Hello, we are in need of seeing if tickets have been commented or had a status change that are still open in the last 30o days, but we can't seem to get it to work. Here is what I have right now:

project = DESK AND statusCategory IN ("To Do","In Progress") AND ((commentedOn < -30d AND commentedBy != assignee ) AND statusCategoryChangedDate < -30d) order by created DESC

Unfortunately, we are still getting tickets that have been commented by the assignee less than 30 days or had a status change less than 30 days ago.

We need help constructing the query so that it won't include tickets it shouldn't. Here are the criteria:

  1. We need all tickets that have not had specific activity for 30 days or more
  2. Activities:
    1. Reply to customers by the assignee of the ticket
    2. status change
  3. The tickets must be in an open status and not completed

Any help would be greatly appreciated. We do have Scriptrunner if that is required for this search but we would prefer if we could use vanilla JQL if possible. Thanks.

3 answers

0 votes
Shiva Kumar Hiremath
Contributor
November 27, 2024

Hello @Ryan Wolfe ,

can you try this 

project = DESK AND statusCategory IN ("To Do", "In Progress") AND (
(updated >= -30d AND NOT assignee in (commentedBy())) OR
status changed >= -30d
) ORDER BY created DESC

Ryan Wolfe
Contributor
November 27, 2024

Unfortunately it does not work, It is saying the status changed ">=" is the wrong operator, so I changed to before which fixed it, but then is says there is no function called commentedBy.

0 votes
İclal Aslan
Contributor
November 27, 2024

project = DESK AND statusCategory IN ("To Do", "In Progress") AND issueFunction in commented("before -30d") AND issueFunction not in commentedByUser("assignee") AND statusCategoryChangedDate < -30d ORDER BY created DESC

 

Hope this helps.

Ryan Wolfe
Contributor
November 27, 2024

issueFunction, Does not appear to be a native function of Jira Cloud and when I tried in Script runner it threw errors as well. This has been my biggest issue with looking up help in the communities, everyone seems to have addons that change the functionality but we have no visibility as to what allows that functionality to be there. 

Thank you for your attempt though.

Marc - Devoteam
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.
November 27, 2024

Hi @Ryan Wolfe 

This is an AI generated answer that has been posted.

This function is a 3rd party app function, that requires that 3rd party app, but AI doesn't know that.

Like Gosia Adamska likes this
İclal Aslan
Contributor
November 27, 2024

Question said that they have Scriptrunner

but i missed the cloud part.

0 votes
Jim Knepley - ReleaseTEAM
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 27, 2024

Hi @Ryan Wolfe 

Yours might be valid, but I've always used a different syntax for date comparisons like that. Maybe try:

project = DESK AND statusCategory IN ("To Do","In Progress") AND ( (commentedOn after -30d AND commentedBy != assignee ) AND statusCategoryChangedDate after -30d ) order by created DESC 
Ryan Wolfe
Contributor
November 27, 2024

I have attempted to try that but it seems to not be working. it is saying that after is not an operator that we can use. Is this using Scriptrunner or another addon?

Jim Knepley - ReleaseTEAM
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 27, 2024

Oh, that's my mistake... "AFTER" is only useful in history queries that include things like "status WAS NOT IN ("X", "Y") AFTER "yyyy/mm/dd"

I should have some time to experiment with your query and see what's up.

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