Add user to field depending on selected options

Use case

Set a User Picker field with one or several users according to the options selected in several fields.

In this use case, the options will be Fruit and Apple in two Select List (single choice) custom fields.


⚒️ Configuration

Add the Update field based on rules to the transition of your choice.

Source field

Choose Summary

Although it is necessary to choose one, this field is not relevant in this use case. We will set it to Summary for demonstration purposes.

Target field

Select a User Picker custom field.

Rules

Add one rule for every possible combination of the fields, assuming that none of the fields can be left blank.

Select Logical expression

Expression

For every rule, evaluate the different possibilities with appropriate logical expressions like the following one.

Bash
"Fruit" = %{issue.cfaaaaa} and "Apple" = %{issue.cfbbbbb}

Please, replace the field codes %{issue.cfaaaaa} and %{issue.cfbbbbb} with the ones from the appropriate fields before testing the post function.

Target field value

Enter the username of the user that should be assigned to the ticket when the logical expression is true.

Bash
user.one

Add several users

If you need to add several users to a User Picker (multiple choices) field, select the option Evaluate all rules and add a plus sign "+" before every target field value.

Bash
+ user.one

Every user that has an associated matching rule will be added to the field.


📚 Related use cases