How to construct multiple If conditions to be executed if value is found in Jira Automation Rule?

Jar Lady
Contributor
April 8, 2024

I want to have a rule that executes in this manner:

-   If field A is not empty

    Do AAA

    If field B is not empty

    Do BBB

    If field C is not empty

    Do CCC

So if all A, B and C fields are not empty, I will expect to have done AAA and BBB and CCC.

Currently I configured in the above manner in the Jira automation rule, but the rule did not execute further of "If field C is not empty" if let's say field B is empty. Is there any example to show the correct configuration?

3 answers

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

Hi Lady,

Since you want all 3 to execute every time, no matter if one is empty or not, you will need to use Branches Use a  Current Issue Branch for each thing to check, then put a Condition under the branch for each item you are checking. Then put under the Condition and Action for what you want it to do if it passes. 

The good thing is that you can create the first branch and all the details, then Copy the branch and just make changes to the Condition and Action for B. Then Copy that one and do the same for C. 

However, these will not fire sequentially, but all at the same time more or less. 

Jar Lady
Contributor
April 8, 2024

Oh thank you, let me try it. How do I copy a branch? 

Jar Lady
Contributor
April 8, 2024

Thank u! Prob solved using current branch.

Jar Lady
Contributor
April 8, 2024

Thank u!

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 8, 2024

If you hover over the branch, you will see a little popup like in the image below. Click on the copy icon. 

Screenshot.png

Jar Lady
Contributor
April 8, 2024

Thank u!

Like John Funk likes this
0 votes
Bill Sheboy
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.
April 8, 2024

Hi @Jar Lady 

Would you please describe the problem you are trying to solve?  That may help the community to offer suggestions, because...

In rules, branches cannot be nested and if / else conditions cannot be defined inside of branches.  And so the scenario you described may not be possible with a single rule:

While iterating over the linked issues,
Perform several different and independent conditions, 
Each of which can produce a different action.

And...if the branch on linked issues was repeated (to allow performing the actions separately) that may not work: branches which could be on more than one thing are run in parallel and asynchronous processing, leading to update collisions for the rule actions on the same issues.

This may be possible if there is a way to make the issue selection distinct with JQL, although that will lead to 2^3 = 8 path branches, using JQL to select the issues.  For example:

  • if A and B and C are empty, the first branch processes
  • if A and B are empty, and C is not, the second branch processes
  • ...
  • if A and B and C are not empty, the eighth branch processes

Kind regards,
Bill

0 votes
Barker
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 8, 2024

thanks for sharing. Office ally  i will also tray this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.10
TAGS
AUG Leaders

Atlassian Community Events