Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,698
Community Members
 
Community Events
185
Community Groups

Setting a multi-select field with Automation

Edited
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jun 13, 2022

I have stumbled into a use-case that I don't quite seem to be able to do.

The simplified case that leaves out all the bits I think I've worked out is:

  • Imagine we have a field for "areas impacted".  It's a multi-select list with say 7 options, named after the colours of the rainbow.
  • Next we have some other fields that might have data, or be empty.
  • We want to do things like "if one field is empty, areas needs to have 'red' selected.  If the field 'Kermit' is not empty, areas needs to have 'green' selected..  If three or more of these fields are filled, areas needs to have 'blue' selected".

I know how to do all the "if" bits. 

I do not see how to create a list of options that need to be set or unset in the multi-select field, or how to then apply that list to it.

2 answers

1 accepted

3 votes
Answer accepted
Yvan Martin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 17, 2022

Hi Nic,

Developer from Automation here.

The best way I can think of would just be to use append/remove APIs when editing the issue, so when those particular IF checks happen you can then just do an action to append the particular field. We do have a "variable" action but it's not currently setup in a way that you can keep appending then do 1 final edit, you'll need to do multiple with your if conditions.

One way to do this if you just need add and not remove is to use a smart value to copy the current fields options, then add the new option e.g. {{issue.Multi Checkbox}}

Screen Shot 2022-06-17 at 8.06.46 pm.png

If you would like more flexibility there is add/remove API with multi issue fields but it's not something we support natively so you'll need to use the advanced option in the edit action mentioned in in https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/  . Here's an example that both adds and removes an option at the same time, you can also have multiple adds if you replace the remove word 

{
    "update": {
        "Multi Checkbox": [
                {
                        "add": {"value":"Option1"}
                },

                {
                        "remove": {"value":"Option2"}
                }
        ]
    }
}

Screen Shot 2022-06-17 at 10.39.25 pm.pngHope this helps.


Feel free to reach out to Atlassian support if you require additional assistance https://support.atlassian.com/.

Cheers.

Hi @Yvan Martin 

I'm trying to do something similar and can't get it to work – I was hoping you could help :) 

I need an automation that does the following: 

1. If the description of the issue contains the word "Danish" select "Danish (da-DK)" from a multi-select drop-down. 

2. If the description of the issue contains the word "Dutch" select "Dutch (nl-NL)" from the multi-select drop-down. 

Etc. with a bunch of other languages. But I need them to be accumulative. I've tried a few things and always end up with only the last listed language being selected in the multi-select. So it's like each step of the rule overwrites the previous one. 

I tried your first suggestion above, using the smartvalue {{issue.customfield_xxxxx}} and adding also the option to be added, but it doesn't work. 

Any tips?

Thank you!

Suggest an answer

Log in or Sign up to answer