I am using scriptrunner to return out of SLA tickets and cannot filter for resolved dates

Anthony Martinez December 17, 2022

I am using scriptrunner plugin and querying for out of SLA tickets that have a resolved date that are 60+ from the creation date.  The problem i am running into is there are quite a few tickets that have a creation date from 3-4 months back without a resolution date.  I also want to include those tickets that have no resolution date but they have to be 60 days or greater than their creation date.

This is what I have so far,  I cant seem to get the last piece to include empty resolution greater than 60 days from the creation date.  DO i add something like this 

created > startOfDay(60d)???  when I add that to the query it breaks.

 
issueFunction in dateCompare("filter = "ENGR: INCIDENTS" AND project !=OPS AND project !="ERS Problems" AND priority = "High - P1" AND created >="2022-01-01" AND Status not in (Canceled, "Won't do/won't fix") ORDER BY created DESC", "resolutiondate > created +60d")

2 answers

0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 18, 2022

Hi @Anthony Martinez and welcome to the community,

If you want to use the startOfDay JQL function to query your issues, then you can use like below:

created >= startOfDay(-30)

 If you add the above on your overall JQL, I think that you will not have a problem.

In addition you have on your JQL the following:

"resolutiondate > created +60d"

which will return always an error. You can't compare variables and/or add numbers (or days) to other variables. JQL doesn't work like this.

Let me know if the above worked out for you.

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 18, 2022

Hi @Anthony Martinez ,

welcome to the Atlassian community!

In order to retrieve tickets created more than 60 days ago you can use the following :

created >= -60d

Please try and let us know.

Fabio 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events