Automation - multi condition

Dana.Harel
Contributor
December 19, 2022

Hi,

I have a costume field called "Department involved" (multi select field)

I'm building an automation to link tasks to different epics according to the field value. 

For example - if the field is selected with "Finance", the issue should link to the specific epic I have for Finance department. 

Additionally, the field is multi select since the issue can be related to several departments. 

Therefore, for example if the field is selected with both "Finance" & "Legal" - the issue should link to both Finance and legal specific epics I have for each of the departments. 

I'm not able to build the automation correctly because if I'm using "If" - the role stops running once one of the departments is chosen (if I have more than 1 departments the issue will link to the first one only) 

I tried using field condition only but the automation changes nothing. 

Would love for some advice here :)

Thanksautomation.png

3 answers

3 accepted

2 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.
December 19, 2022

Hi @Dana.Harel 

You do not say how you determine the specific epics to link to for each value in your Department Involved field.

Let's assume it is one of these

  • The epics have something in the summary (or another field) which associates them
    • Using an branch on the values in your custom field with JQL to find the epics...link to the trigger issue.  Assuming a custom field, it could be this using list iterator values:

project = myProjectName AND issueType = Epic AND myEpicsCustomField IN ( {{#triggerIssue.Department Involved}}"{{value}}"{{^last}}, {{/}}{{/}} ) 

 

  • The epics have no way of indicating the value; they are just specific epics
    • Try using repeated if/else conditions to link to the specific epics

 

Kind regards,
Bill

Dana.Harel
Contributor
December 19, 2022

Hi @Bill Sheboy , thanks. 

The epics are already created - I opened a specific epic for each department.

I want the automation to link the issue to the correct epic according to the option selected in the field "Department involved"123.png

 

The problem I'm having with the automation is that once more than 1 option is selected in this field - the automation links the issue only to the relevant epic for the first option. The rule stops from running after the first option is true in the condition. 

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.
December 20, 2022

That is what I would expect if just using the conditions, and it is why I suggested either using the branch or if/else, as @Vamsi Kandala also suggested.

For example...

  • trigger: your custom field changes
  • condition: issue type is not epic
  • branch: on the JQL I described to gather the selected values
    • action: link to the trigger issue

This will not handle the case of removing values (and their links), which is a bit more complex.

0 votes
Answer accepted
Dana.Harel
Contributor
December 21, 2022

msedge_lyl0I9AUQM.png

 

Hi - This seems to workout for me

Thanks

Vamsi Kandala
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.
December 21, 2022

Hi @Dana.Harel

Good to know that.

Thanks,
Vamsi

0 votes
Answer accepted
Vamsi Kandala
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.
December 19, 2022

Hi @Dana.Harel

Did you try using the 'If / else block' instead of 'Issue fields condition'?

Thanks,
Vamsi

Dana.Harel
Contributor
December 19, 2022

Hi @Vamsi Kandala I did use a single 'If / else block'. The problem is that once one of the conditions is true, the rule stops running.

This causes a problem in which if I have to options selected under the field, the issue will link only to the epic of the first option

Vamsi Kandala
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.
December 20, 2022

Hi @Dana.Harel

The 'if/else' block has additional feature to check if all conditions have to match or at least one condition.

If Conditions.png

Hope this helps.

Thanks,
Vamsi

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