Can I use automation rule to trigger another automation rule?

Itay Kaplan October 10, 2018

When using Automation for Jira, can I use automation rule to trigger another automation rule?

For example:

I have rule that creates "Task A" when I create "Story B"

Also, I have a rule to create "Story B" when I create "Epic C".

 

I would expect that whenever I create "Epic C" it will trigger the "Task A" rule as well

 

8 answers

1 accepted

11 votes
Answer accepted
Robin Flood October 10, 2018

Hi Itay!

Yes you can allow this by checking the box next to Allow rule trigger in Rule details.

Project_automation_-_JIRA.png

Hope that it answered your question :)

Itay Kaplan October 10, 2018

works like a charm :)

Thanks!

Robert Horan
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
April 30, 2019

Thanks!

Like # people like this
Mohamed Zouaghi April 13, 2020

Hi Guys,

 

This is what I'm trying to achieve:

I have 4 rules that must be executed following a specific order:

Rule-1, Then after completion

Rule-2, Then after completion

Rule-3, Then after completion

Rule-4

All of those rules have the same trigger: "When issue is created"

 

Can I achieve this in a consistent way or not?

Like # people like this
Chris Carpenter June 17, 2021

I did this with labels. Rule 1 added a label that caused rule 2 to trigger. Rule 2 would clear rule 1s label so things didnt get messy, then rule did its thing and added a second label, etc...

Not pretty, but it worked!

Like # people like this
Robert Horan
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
September 20, 2021

@Chris Carpenter I love this idea.  One quick question - when all is cleared do the temporary labels still appear in the lookup for labels?

Chris Carpenter September 20, 2021

Hey @Robert Horan!

They dont actually. Here's an example of a rule I set up to auto assign bugs to the assignee of the story that the bug was linked to:

2021-09-20 14_15_51-2021-09-20 14_12_53-Project automation - Prodigy JIRA.png ‎- Photos.png



The label applied by the rule is "---assignee" where --- is the project name. That label always shows up as "new" when you type it into the label field on a jira ticket, since it never exists on a ticket in our system for more then a few seconds

2021-09-20 14_17_44-[WS-803] Menu styling inconsistent during browser resize - Prodigy JIRA.png

Like Robert Horan likes this
Steve Letch October 19, 2021

That seems strange that it's not in your list of existing labels. Why are you doing it that way? Why not use a project picker custom field and call it Project Assignee or something, for example we have one called 'Implementation Team' for Planned Change issue types where they're raised in project A but done by the Team that lives in project B.

Madineni February 10, 2022

Hi my requirement is almost same. I have Rule1 which has a trigger when an issue is created and it updates reporter filed with the mail id available in the description field.

Rule2 trigger is when an issue is created and it updates location field based on the group in which reporter is a member and it is a global rule and applicable for all projects.

Since both rules have trigger both will execute parallel. Now my problem is Rule 1 fetches email in the description and copies into the reporter filed, hence first reporter name will be erased and new one will be stored. But Rule2 updates location field based on first reporter field and hence location will not have correct value.

In this regard I want to trigger again Rule2 after execution of Rule1. Can any one suggests to fix this. 

Thanks,

Madineni. 

5 votes
Kirby Knight March 5, 2019

Hi there. I think this is what I'm looking for, but I'm confused of how to trigger this rule from another. The checkbox says to allow other rules to trigger it, but what do I do on the rule that's supposed to be the trigger?

Not sure I'm asking that clearly, but I hope you get the gist! 

Itay Kaplan March 5, 2019

Hi,

You don't need to do anything special in the "trigger" rule. The action that this rule triggers should be an action that trigger the 2nd rule.

 

For example:

Rule 1# - if all tasks in a story are set to "DONE" > update story status to "QA"

Rule 2# - Whenever a story is moved to "QA" > assign the QA lead and send an email

 

Hope this makes sense

Like # people like this
Dane Kantner August 2, 2021

There are two different forms of questions being asked in this overall thread we've been sent to. Both relate to rule triggering but they're different underlying questions/use cases. The distinction is in one scenario there would be a way to add an ACTION in a rule to call another rule vs the rule being capable of triggering because another rule took an action that made triggered some underlying event (which itself is a weird oddity in the first place that it doesn't just trigger by default)

 

(though it sounds like the answer to this question is : No it is not possible yet.)

Like # people like this
Archi Apronti February 16, 2022

Indeed, they are two separate scenarios. One involves the same automation rule with 2 or more separate actions, and the other involves two separate automation rules with one dependent on the other. I will update if I find a solution for the latter.

1 vote
Jeffrey Bistrong
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.
February 8, 2022

@Chris Carpenter 's suggestion worked for me, when automation rule #1 finishes it add label X to the ticket, and then automation rule #2 looks for tickets where label = X and then run. Like he said,  it's not pretty, but it works. 

1 vote
Paul Wright September 17, 2021

Great inspiration in this thread.

 

I wanted to create 4 stages to a process due to the volume of sub tasks that needed to be raised, so each time a primary ticket was raised you had to manually push through the workflow to have the sub tasks created.

I added a custom field (called Stage) and when the value change the automation ran.

If the value was x, then the relative sub tasks were created. Once they ran, the automation changed the value to y and the relative sub tasks were related, and so on.

Getting the first part of the 'if' to change the value and then as the value changed the automation run.  Very smooth.  25 sub tasks created in minutes and all automated!

I did find out (the hard way) to check your logic.  I initially caused a problem when 2000+ tickets were created in a loop!  Thank goodness for test projects and delete permissions!
Paul Wright September 20, 2021

Update:  I've not got the post function changing the value 'Stage' which then prompts the next automation to run, so all sub tasks are fully automated.  (I do love a good automation!) :) 

1 vote
Chris Howard May 20, 2020

Not sure if this can still help.
But I created a rule to add a comment, then another rule to be based off that comment text.
 
Rule 1;
SLA 1 hour after 1 hour > Add Comment "You have not responded to this in an hour"

Rule 2;
Comment Added > IF Comment Contains Text "You have not responded to this in an hour" > Trigger alert through Webhook.

Risks - If someone adds this text specifically, it will raise an alert. So you have to make it unique as possible. Potentially you can put Symbols at the start and end like !"You have not responded to this in an hour"!
You just have to trust people in your company not triggering the alert themselves...

Steve Letch September 17, 2021

I find the trigger thing bizarre, especially when the 'when' can be issue updated/created. you'd think well, surely my trigger should ALWAYS trigger the rule to run, whether the tick box is ticked or not.

1 vote
Waqar Public Name August 14, 2019

Hi

I think  might not be understanding this correctly. Let me describe my scenario. 

I have some fields that are populated from data available in other fields on a manual trigger by the user. 

 

Now I want to create another rule that will do the same but not on manual trigger but based on 

1. Transition to a certain Status

2. Edit of an issue field (one of the custom fields that I am using as input for populating the others fields in manually triggered rule.

 

Is it possible to execute the manually triggered rule based on the triggers mentioned above in 1. and 2. 

Or do I need to recreate the same rule but with different trigger which are transition trigger and Issue field update trigger.

0 votes
Rita Torok May 24, 2022

Hi 

I am looking for a rule or a combination of rules to achieve the following:

When the sum of worklogs in current month reaches 20h in an epic, then an email should be sent to a specific email. 

Is this possible at all?

Thanks

0 votes
Andrii Babichev August 3, 2020

I haven't found an action to trigger one rule from another rule. Please could you help me understand, how does the "Allow rule trigger" checkbox should imply?

Chris Miller August 20, 2020

I have the same question.  I have automated rules for transitions.  Say #1 is Manually updated tasks and subtaks, and then  #2 Close Epic if all tasks/subtaks done (this is done during transitions)

I manually run #1, but I want it to kick of #2 after it finishes #1.  How do I do that?  What do I do in #1 to get it to go to #2 

Like Heather Arbiter likes this
Heather Arbiter December 15, 2020

It's a little clumsy but I accidentally stumbled across this solution: Add to the workflow a same status loop that triggers the manual automation. Then you can push the issue through that status in your second automation which will trigger the first one. (Allow rule trigger checkbox was not required).

It isn't ideal though. Allowing an automation to trigger another one seems pretty desirable as the alternative if you want to have an automation that can also be triggered manually you seem to just have to duplicate and maintain two automations. 

Like John Perkins likes this
Gena Welk February 7, 2023

Hello, since @Chris Miller 's question was asked in 2020, I was wondering if there is any further guidance on this?  My questions is the same.

Any guidance suggested will be greatly appreciated.

Like Damian Stoychev likes this
Paul A Wright February 9, 2023

Hi Gena, 

I did respond Sep 17, 2021 which I believe answered the question. 

From memory, I used an automation to change a value, and when the value changed the automation would trigger again.

There are some good responses above from various contributors that all essentially say the same thing, "Yes".  

Worth testing in a non-prod environment.

Good luck

Paul

Gena Welk February 9, 2023

Hi @Paul A Wright ,

Thank you.  I was hoping there was a more direct way to invoke the needed automation, as it seems there's a common "fuzziness" about the use of the "Allow rule trigger."

If using labels or custom fields is the best way to do this, then I will follow suit, as has been described in this thread.

I would much prefer to create an action in my automation where I could fire off the desired subsequent automation.

Like Jonathan Phillips likes this
Paul A Wright February 9, 2023

Hi Gena

You raise a good point about the approach as it is fuzzy.  I wouldn't use labels personally as they are very 'sensitive'  (label that = "Test" is different to one that = "Test") as they're case sensitive and anyone could use your label and initiate a trigger.

It should be something unique.  One thing I did later on was use a transition as a workflow and the transitions were unique.

So, I would use the automation to trigger and it would transition a ticket from one status to another.  The transition would be a trigger for another automation to run, and so on.

It's a bit messy, and you have to be a bit creative (and remember the logic by using great description in your automation tasks), but it is achievable and can be very successful.

Another thought - depending on the complexity of what you want to do, you could use post functions in conjunction, which could be conditional.  

Personally, I grab a large A3 sheet of paper or a whiteboard, and draw the logic until I'm happy.  

Sadly, I'm yet to see a conditional trigger in an existing automation - I don't know if it's on the development radar but it would be a useful improvement.  I suspect this type of function does cause the risk of an infinite loop (as I found to my own detriment), so use with caution!

Good luck!

ERIK GAUDIN April 4, 2024

I try the "Add rules Trigger".. but can't find how to trigger that rules.. on completion of another rules... 

How do we perform that ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events