Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation for Jira - Logical OR statement within an IF block

Malka
Contributor
June 11, 2020

I have three fields: 

  1. Release Notes Required
    1. Both
    2. Internal
    3. External
  2. Internal Release Notes
  3. External Release Notes

Based on the answer selected on field 1, I want to check the population of fields 2 and 3. So if Both is selected in field 1, I want to check if either 2 or 3 is empty and generate an alert. Where are the ORs in Automation for Jira?

4 answers

1 accepted

2 votes
Answer accepted
Mykenna Cepek
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.
June 11, 2020

It's not the most intuitive approach, but this might work for you...

Try using a "Branch rule / related issues" component instead of a "New condition" component.

Start with a "Branch rule", and for "Type of related issues" select "JQL".

Your JQL could be:

"Release Notes Required" in ("Both", "Internal")

for the first clause, performing the desired internal operations in that branch clause.

At the same level you can use another branch with JQL:

"Release Notes Required" in ("Both", "External")

for the second clause, performing the desired external operations.

An alternative is to use a single "If/else block" conditional like this (using pseudocode):

If "Release Notes Required" = "Internal"
Then DoInternalStuff
ElseIf "Release Notes Required" = "External"
Then DoExternalStuff
Else
DoInternalStuff
DoExternalStuff

 

I hate duplicating stuff, so I don't like that approach as much.

Do share back here with what worked for you! 

0 votes
Evan Aronson
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!
March 5, 2022
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.
June 11, 2020

Hi @Malka 

I don't see any OR conditions... Only AND using sequential condition tests.

Have you tried something like a trigger on a change to the Release Notes Required field, and then use either a JQL condition containing an OR clause, or If/Else to send the alert you want?  The If/Else may be better for your case, and faster too.

Best regards,

Bill

Malka
Contributor
June 11, 2020

Thought about that, but it would require them completing 2 and/ or 3 prior to 1. 

That's why I'm leaning towards the check at time of transition. Oh aaand ro make it more fun, I'm checking these three fields in a parent of the transitioning issue. 

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.
June 11, 2020

Gotcha; so this depends upon the level to which you want to nag...I mean alert...someone.  As the sub-task is the item changing, it doesn't matter the conditions of the parent's fields; you just want to alert about missing data, correct?

You might need a triggered rule on the sub-task, and either a manual or scheduled rule for re-check. (Or better still, a filter subscription independent of the rule.)  If you want to limit the alerts, you could flag a comment after someone has been notified, and check for it as a condition to prevent re-alerting.

  • Trigger: sub-task transitions from status-A to status-B (or whatever you are choosing)
  • Branch: parent of sub-task
  • Condition: If/else for your number of alerting scenarios
  • Action: email, comment, etc. to alert
Like John Funk likes this
0 votes
Anand Inamdar_Amoeboids
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.
June 11, 2020

From my limited knowledge of Automation for Jira, it does not look like what you are trying to do is easily achieved (if at all possible).

Do share the solution here if you find a way do it.

Best,
Anand

Malka
Contributor
June 11, 2020

Thank you for your product's advertisement but it does nothing to solve the issue I am having. 

Anand Inamdar_Amoeboids
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.
June 11, 2020

My apologies if that came across as an advertisement of sorts. I've just removed that part from my response. 

Would still love to know the solution if you find one that relies on Automation for Jira.


Best,
Anand

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events