Forums

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

Automation: Add a Jira Group to email if IF/ELSE is unavailable in related issues branch?

Casey Gould
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.
September 16, 2024

I know what I want to do, and I know how I would do it, but as far as I can tell, "IF/ELSE" isn't an option when under a branch (Parent issue).

 

This automation:

If a story moves to In Progress AND conditions are met, move the parent to In Progress as well, and send an email which contains a lot of field details about the parent.

Today, that email gets sent to the initiator and 2 custom user fields, which works great. Now I want to add one of three manager groups to the email as well, based on which of 3 filters the Parent is in.

Options I see:

  1. Do the logic on which management group should be notified before branching to the parent, save the appropriate group name to a variable, add that variable to the CC field on the email. Would this even work?
  2. Save all the fields I want from the parent to variables and run the logic afterwards (please no).
  3. Create and maintain three separate instances of this automation, one per manager group.
  4. Jira lets us use IF/ELSE underneath a related issue branch.

Any suggestions?

2 answers

1 accepted

0 votes
Answer accepted
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.
September 16, 2024

Hi @Casey Gould 

You are correct: currently, an if / else condition cannot be used within a branch.

Sometimes this need can be solved by inverting the cases: use if / else, and put the branches inside of each case.

That may not been needed for your scenario.  For your specific questions / options:

#1) Yes, you could use variables to select the users into a variable, and then use that in the email addressees.  The "trick" is to ensure the values are split into separate values, or joined with semicolons.

#2) Although what you describe is possible, it is likely not needed.  If the email content is conditional, perhaps use the inline conditional logic to help: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-conditional-logic/

#3) Please see above for other options, as having three versions of the automation rule will create maintenance problems for your team(s).

#4) As already noted, this is not possible.  Please note well: there was a quirky behavior (i.e., defect) in the past where the rule editor allowed dragging such conditions inside of branches.  As that behavior is likely a defect I suggest not using it or expecting it to work.

 

Kind regards,
Bill

Casey Gould
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.
September 17, 2024

Hi Bill, Thanks for confirming 4 is not an option (and I'm not just missing something in the updated UI). The inversion aspect is interesting - I wonder if I would be able to do the project check logic I need on the Parent field of the trigger story before going into the Parent branch. I'll try that next.

Like Bill Sheboy likes this
0 votes
Trudy Claspill
Community Champion
September 16, 2024

Hello @Casey Gould 

#4 is not an option. You are correct that the IF/ELSE option is not available under a Branch.

Can you clarify this point?

based on which of 3 filters the Parent is in.

Exactly what condition are you trying to apply here to determine the group to whom the email should be sent?

One alternate option I can think of is to create a rule just for that evaluation and sending of email. Have that new rule use the Incoming Webhook trigger. The trigger that rule from within the branch of the first rule using a Send Web Request action. I haven't tried to do that myself, but I have seen it done.

Casey Gould
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.
September 17, 2024

Hi Trudy,

I need this automation to apply to ~20 projects. I currently have 3 filters set up to group those projects by essentially who the bosses are in a reusable way. So this is triggered on a story, then based on the project of the parent epic (which is often different), I need to include one of three sets of bosses.

Thanks!


ex: Projects A-F

notify group X for filter X: project in (A, B)

notify group Y for filter Y: project in (C,D)

notify group Z for filter Z: project in (E, F)

Suggest an answer

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

Atlassian Community Events