Trigger a second rule after first rule completes
Asked by Kazumi Kerr:

Hello,

I created 3 automation rules because there were over 100 steps and needed to split into multiple rules. I'm trying to figure out how to trigger a second rule after the first rule completes. Similarly, how to trigger a third rule after the second rule completes.

In a rule detail, I checked the "Allow rule trigger" option.![trigger.png](https://community.atlassian.com/t5/image/serverpage/image-id/167632i651553BEF7F0FAD5/image-size/large?v=v2&px=999 "trigger.png")

However, I believe I need to have some kind of conditions to specify "the rule 2 starts after rule 1 completes". Does anyone know how to solve this?


Answers:
author: Mykenna Cepek
body: My first thought would be to define a custom field to support triggering for rule chaining.

One such field could support all projects in an organization, as long as you controlled the field content across all your rules.

The "Field value changed" trigger will then focus on changes to that field for later rules in the chain. For a rule configured for a single project, this should not trigger excessively.

For the content of this field, I might suggest a GUID. That way you don't have to maintain a list of them (to avoid collisions with other rules using the field).

How would this work? After creating the custom field in your instance and configuring your project(s) to access it, you'd do the following to chain Rule A to Rule B:

* Generate a new GUID (there are plenty of online GUID generators).
* At the end of Rule A, set your custom field to have the GUID value.
* Trigger Rule B on the custom field changing, and use a conditional immediately to confirm that the custom field value matches this GUID.

Rule B should, of course, use the checkbox to enable other rules to trigger it.

NOTE: If your custom field is scalar (holds a single value), then ensure each project only has a *single rule chain* . If you want to support *multiple rule chains* in a single project, a bit more complexity is required:

* Create the custom field as Standard type "Labels", which allows for multiple values.
* Rule A should ADD the GUID to the custom field.
* Rule B should REMOVE the GUID from the custom field (after detecting a match).

Would be interested to know if this solution works for you!

comments: author: Kazumi Kerr
body: [@Mykenna Cepek](/t5/user/viewprofilepage/user-id/3527113)   

Thank you for your suggestions. I understand theoretically, but I'm not sure how to execute it due to my lack of experience in Jira automation.

I created sample rules: "RULE 1" and "RULE 2". However, when I tried to create a project, only the Rule 1 was executed. I'm sure my syntax in Rule 2 condition is incorrect.

![Screen Shot 2021-11-04 at 5.58.12 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/168069i75B73B661CA8DF9F/image-size/large?v=v2&px=999 "Screen Shot 2021-11-04 at 5.58.12 PM.png")

![Screen Shot 2021-11-04 at 6.02.36 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/168070i589B2BBF112DB371/image-size/large?v=v2&px=999 "Screen Shot 2021-11-04 at 6.02.36 PM.png")![image (1).png](https://community.atlassian.com/t5/image/serverpage/image-id/168072i2E21B8516DEE7213/image-size/large?v=v2&px=999 "image (1).png")


author: Kazumi Kerr
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) \& [@Mykenna Cepek](/t5/user/viewprofilepage/user-id/3527113) ,

It worked!

I created a sequential rule by looking at the {{issue.summary}} and it successfully made tasks in order.

Thank you for your help!![Screen Shot 2021-12-05 at 7.57.40 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/172342i15C0C518921B98AD/image-size/large?v=v2&px=999 "Screen Shot 2021-12-05 at 7.57.40 PM.png")![Screen Shot 2021-12-05 at 7.56.05 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/172343iC5979412D67C43B8/image-size/large?v=v2&px=999 "Screen Shot 2021-12-05 at 7.56.05 PM.png")


author: Bill Sheboy
body: Hi [@Kazumi Kerr](/t5/user/viewprofilepage/user-id/4620542) -- Welcome to the Atlassian Community!

You are describing splitting down a rule with over 100 steps, and then triggering those rules sequentially.

I wonder if all of the steps you note are one atomic operation, or if there could be separate rules triggered on changes made...or even better, utilize the looping operations from advanced branching to help make a smaller rule. And perhaps some process analysis would reveal other simplifications to the rule (e.g. combined condition testing).

Given the limitations in the rule editor and error handling, smaller rules would be easier to maintain and improve.

Kind regards,  
Bill

comments: author: Kazumi Kerr
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)   

Thank you for your suggestions. I agree that smaller rules would be easier to maintain and improve.

The rules I try to make is to crate a list of tasks/subtasks for each project. So, I would like to perform the rule 1 --\> rule 2 --\> rule 3 in order.