Closing issues after they have stayed 20 days in a status. Sheduled trigger JQL problem
Asked by Stanislav Kotakov:

Hello All,

We are struggling with an automation rule that is supposed to check certain projects with specific issue types that have been in their current status for 20 days. The goal is to determine whether the issue has not been updated by our customers for 20 days while in the 'In Verification' or 'Waiting for customer' statuses, and if so, to transition the issue to 'Done' with an 'Expired' resolution. Occurrence every day 06:00AM in the morning.

However, I am having difficulty setting it up correctly.

Here is an example of the JQL that I am currently trying to make work:

**category = "Client Support" AND issuetype IN ("Pre-Paid Support Service Request", "T\&M Support Service Request","Emergency Support Service Request","Warranty Support Service Request", "Consultancy Support Service Request", "Standard Support Service Request") AND status IN ("In Verification", "Waiting for customer") AND updated \<= -20d**


Answers:
author: Stanislav Kotakov
body: I should have provided more information about the topic. We have a field called *All Time Spent,* which is automatically populated by Automation for Jira (system user), and this counts as an update.

comments: author: Marc - Devoteam
body: Hi [@Stanislav Kotakov](/t5/user/viewprofilepage/user-id/5293776)

Then this is the culprit indeed.

Then you would require to exclude all your projects in the category Client Support.


author: Marc - Devoteam
body: Hi [@Stanislav Kotakov](/t5/user/viewprofilepage/user-id/5293776)

It might be in the clause "issuetype IN", I think you have specified Request Types, then the clause should be "Request Type" in ()

Are all the projects your a trying to tackle in the JQL set with the project category "Client Support"?

Other wise try to break down your JQL.

Does the JQL **category = "Client Support" AND issuetype IN ("Pre-Paid Support Service Request", "T\&M Support Service Request","Emergency Support Service Request","Warranty Support Service Request", "Consultancy Support Service Request", "Standard Support Service Request")** give the correct results?

Then extend the JQL and check the results any time on adding clauses.

Other option is the automation set to global or multiple projects?

comments: author: Stanislav Kotakov
body: Hi [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) ,

They are issue types named 'Requests,' and yes, all of the projects that this JQL is meant to check are in the 'Client Support' category. It does bring almost correct results, but the core problem is that it does not filter the aforementioned issue types that have been in the 'In Verification' or 'Waiting for customer' statuses for 20 or more days.


author: Marc - Devoteam
body: Hi [@Stanislav Kotakov](/t5/user/viewprofilepage/user-id/5293776)

Break you JQL down and add clauses one by one, every time check if the results are correct.

So you say the 20 days is not correct.

Does

**category = "Client Support" AND issuetype IN ("Pre-Paid Support Service Request", "T\&M Support Service Request","Emergency Support Service Request","Warranty Support Service Request", "Consultancy Support Service Request", "Standard Support Service Request") AND status IN ("In Verification", "Waiting for customer")**

provide all the right issues, or are there wrong issues as well?

I expect that you checked this and the answer is Yes.

Then I think the issue is in the notation of updated, can you modify it to: **updated \<= "-20d"**


author: Stanislav Kotakov
body: [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976),

Thank you for your responses, but I have already tried that. After your comment, I changed it to '**updated \<= "-20d"** ,' but the result shows **0 issues found**, which is not accurate.


author: Marc - Devoteam
body: Hi [@Stanislav Kotakov](/t5/user/viewprofilepage/user-id/5293776) ,

Your JQL like this works and gives results

**category = "Client Support" AND issuetype IN ("Pre-Paid Support Service Request", "T\&M Support Service Request","Emergency Support Service Request","Warranty Support Service Request", "Consultancy Support Service Request", "Standard Support Service Request") AND status IN ("In Verification", "Waiting for customer")**

Are there any issues in the list with an updated date earlier then 20 days ago?


author: Stanislav Kotakov
body: Yes, there are.


author: Marc - Devoteam
body: Hi [@Stanislav Kotakov](/t5/user/viewprofilepage/user-id/5293776)

Can you share a screenshot.

I tried the same now: **category = JSM and type in (Support,task, "\[System\] Service request") and status in ("In Progress", "Waiting for support") AND updated \<= -20d**

This gives issues that have not been updated 20 days ago. Most recent update issue os from 24 of July.

Ran the JQL today on the 16 of August, so this is correct.


Tags: cloud

jira-cloud