Forums

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

Automation: Assign users to Multi-user field based on Checkbox values

Patrick Lewallen December 6, 2023

We have an intake form that requires the submitter to select products affected by the request. This field is called "Product Areas Impacted" and it is of the checkboxes type.

Based on the selected Product Areas, I want to assign users to a multi-user picker field called "Product Area Owner(s)". The users in this field are used for an approval step.

A product area owner can own multiple areas.

 

I attempted to create this automation. However, only 1 user ever populates in the Product Area Owners field. 
image.png

2 answers

1 accepted

1 vote
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 6, 2023

Hi @Patrick Lewallen 

The reason only one value is persisting is because the later updates replace them.  When rules run, they do not automatically update the information in the trigger issue; instead the rule "sees" what was present at the time the rule started.

When an automation rule changes an issue, and you want those changes to be used later in the rule, try adding the Re-fetch Issue action after each edit / update.  That will reload the issue before proceeding with the other rule steps.

 

Another way to implement your scenario is to add all of the owners in one single edit, using advanced edit with JSON; smart value, list filtering, and created variables.  That is a bit more complicated, so please let me know if you want information on trying that approach.

 

Kind regards,
Bill

Patrick Lewallen December 6, 2023

Bill!  Adding re-fetch worked! Thank you. For the second option that you listed - would you consider that to be the more "proper" way to address this? I am running into the 65 component maximum for this automation. Would the second option be cleaner than having multiple automations set up? if that is the case, I would love more information. Thanks again!

Like Bill Sheboy likes this
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 6, 2023

Awesome; I am glad to learn that helped!

On your follow-up question...for this scenario, I do not believe there is a "proper" way to do this; just what makes sense for your team.  Here are three ways to solve this, the first you are already using:

 

(1) Using your solution if branching and if conditions, plus the re-fetch actions, is easy to read, and maintain.  The challenges are the potential rule length and errors from nearly duplicate actions being repeated.

(2) Another simple way to do this would be with Lookup Tables: use your Product Areas Impacted values as the key for the table, and the account id values of the users as the data.  Then a simple lookup get() call could supply the users needed; this may remove most of the rule steps.  Please look here to learn more about that approach: 

(3) The other way I was describing earlier, is where a JSON expression is created for the edit by concatenating together multiple, conditional filters on the field.  This will definitely be harder to maintain (and explain to others).  The technique is helpful to know as some scenarios can only be solved this way.  Here are some references on this if you want to try it (although I'd recommend trying the Lookup Tables first if you are just experimenting :^)

Like Patrick Lewallen likes this
0 votes
Ralf Fehling
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 6, 2023

👋 Patrick

🔭 https://confluence.atlassian.com/automationkb/automation-for-jira-how-to-update-the-request-participants-or-a-multi-user-picker-field-from-the-content-of-other-fields-1216971334.html

⚠️Make sure to include the smart value below, otherwise any existing user in the Request Participants field will be deleted by this action. You can do it by copying/pasting the content below and taping the enter key. The text will be automatically detected as a Smart Value:

{{issue.Product Area Owner(s)}}

❓How do you insert "copy from issue"? 

Patrick Lewallen December 7, 2023

Hey Ralf!

I ended up going the route that Bill described above. As far as the "copy from issue", it is part of the dropdown for the edit issue component of the automation.

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