How to ensure the automation rule runs only once

Dalia El-Dib October 5, 2022

Hi,

I know this was asked already here: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/How-can-I-ensure-an-Automation-rule-only-runs-once-for-an-issue/qaq-p/653124 and looks resolved, but the solution there does not work for me. Any clues?

1 answer

1 accepted

0 votes
Answer accepted
Frederic Chartrand
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.
October 5, 2022

Hi Dalia,

I think that the best way to do so would be to create a custom field (e.g. "Rule executed") and add this field to the "View/Modify" screen of the projects you want.

After that, you create your rule and you start by checking if the field is empty. If it is, you execute your rule and you add an action at the end that says : Modify the custom field "Rule executed" and add a Y in it. This way, next time this rule will be executed, since the field is not empty, the rule will not execute.

Hope this helps.

Have a nice day

Frederic Chartrand

FMX Solutions - Gold Solution Partner

Dalia El-Dib October 5, 2022

Thanks @Frederic Chartrand yes this makes sense, but is there another way to do it without adding an extra field to the issue. In fact we have many independent rules (not only one) and each one should run only once, so will be redundant to create a custom field for each rule.

Frederic Chartrand
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.
October 5, 2022

Oh that's trickier than I thought. :)

Now this is just a thought and I never tried it but ...

Maybe the rule could add a comment to the ticket. Something like : "Automation Rule 1 executed"

And if you can find a JQL query that look through all the comments to find a comment by Automation for Jira containing "Automation Rule 1 executed" you don't execute the rule, else you execute it. I tried to find the JQL that would let me find a comment that meet both of this conditions but so far, didn't find anything. I'll update if I find something.

Dalia El-Dib October 5, 2022

Awesome, I love this idea @Frederic Chartrand , if you can find the JQL which would search the comments please share

Dalia El-Dib October 6, 2022

The rule was about creating a subtask with a specific title, so I added a (related-issue) condition to confirm with a JQL that existing subtasks are not part of a JQL querying all subtasks with the same title (summary) and are not Done yet.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events