Blog - Isos Technology

Automation: Extend workflow features / Control Rule Execution Order

Written by Bryan Waters | Jun 24, 2024

Automation for Jira opens a lot of possibilities to extend basic Jira workflows.  For example, have you ever needed to execute a set of repeatable automated actions due to a workflow transition?  Or looking for a way to control the sequence of rules being executed?

In this example, the workflow transition executes an automation rule for each approval level.  The automation rule is triggered and runs through a set of conditions/actions based on the approval level.

  • Create a custom field to call the command:  z_Workflow_Command
  • Use a post function to set the command value

  • Create an automation rule to trigger based on the command name.  
    • The below automation rule is triggered when the post function sets the command value.

                 
NOTE:  The last action of the rule is to clear out the command value so the rule is only triggered by workflow.

Rule Sequencing/Go To

Let’s start with an example of having 5 automation rules with the Issue Created trigger.  Have you ever wondered how Jira decides the order of rule execution?  Or need subsequent rules to execute as a result of another automation rule?  With the concept of automation rule order, you can have full control over execution order and chain the rules to meet your business requirements.  Here are the steps to implement this functionality:

  • Create a number custom field with default value = # 1:  “Automation Rule Order”
  • Create an automation rule to be the starting point
    • Use the Edit Issue action to set  “Automation Order”  to be the next one to execute.
  • Set to # 2 to trigger the next rule in sequence
  • Set to # 5 to skip(go to) a rule in response to rule #1

Example set of rules to be executed based upon their corresponding sequence value:

The starting rule will initiate the rule sequence and will branch from there based on the business requirements.  The subsequent rules will have an ‘Issues FIeld Condition’ to evaluate the sequence value

NOTE:  Enable the "Check to allow other rule actions to trigger this rule" option to allow the rule to trigger when the automation rule order value is changed.

Get Started

Optimizing your workflow and ensuring the precise execution of control rules are essential to stay ahead. Our expertise allows us to design solutions that fit your organization's unique needs, enabling your team to work smarter and faster. Ready to take your automation capabilities to the next level? Contact us today to get started.