Forums

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

JQL condition for scheduled Automation rules

Dilyan Yanev
March 22, 2023

Hello,

I need help for scheduled Automation rules that I'm trying to run to check for issues in a specific status and how long the issue is in this status from the last time the transition occured. They will run once per day.

In fact, the idea is to be 3 separate automations writing comments in the issue notifying the client that the issue will be closed soon due to inactivity. The last rule will close the issue. Custom field checkboxes are marked to asure that one rule will not be run on the same issue again the next day. Another automation watches for customer comments to unmark checkboxes. This part works fine.

The problem is with the JQL conditions for the rules. They don't check the last time this transition was made but all of the transitions to the status specified in the issue history:

Condition for Rule 1 (transitions in 10 to 19 days ago) 

status changed to "STATUS" BEFORE startOfDay(-10d) AND status changed to "STATUS" AFTER startOfDay(-19d)

Condition for Rule 2 (transitions in 20 to 29 days ago)

status changed to "STATUS" BEFORE startOfDay(-20d) AND status changed to "STATUS" AFTER startOfDay(-29d)

Condition for Rule 3 (transitions in 30+ days)

status changed to "STATUS" BEFORE startOfDay(-30d)

For example, with the first condition I get issues that were transitioned yesterday and in issue history I see they were transitioned in the past to "STATUS", so the rule will run on them. Which will be wrong.

 

Is there a way to add something to the JQL that shows only the last time issues were transitioned to "STATUS"?

Hope I described the task clearly.

Thanks in advance!

4 answers

2 votes
Nic Brough -Adaptavist-
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 Champions.
May 14, 2018

Jira does not have field level security, so there's not a lot you can do here.

If you mean "hide field from users", you can't.  Jira is a collaboration tool, and hidden data is an anathema to collaboration, so it doesn't do it.

If you want to stop people editing a field, then you need to move the edit into the workflow.  Remove the field from the "edit screen", then create transitions in the workflow that use a transition screen with the field, and are protected with conditions that limit who can use the transition,

Thiago Ribeiro [Adaptavist]
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 Champions.
May 14, 2018
Ali Hamouotu
May 15, 2018

Thank you very much

1 vote
Nic Brough -Adaptavist-
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 Champions.
May 14, 2018

Add a custom field for the "solution version" and then explain what you mean by "locking" to us, because it is not clear.

Gezim Shehu [Communardo]
Community Champion
May 14, 2018

Seems like today is the day of no details lol

1 vote
Thiago Ribeiro [Adaptavist]
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 Champions.
May 14, 2018

what do you mean by locking?

0 votes
Ali Hamouotu
May 14, 2018

i want to make this field "Solution Version - in Requierement" unavailable for some Users

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events