Add users from Asset attribute as request participants
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
This document details how to automate adding multiple users as request participants based on an asset's attributes. It covers the process of configuring the automation to include them in relevant requests.
Automation's behavior with user Asset attributes
When using automation to copy users to an issue field from an assets object attribute, only the first user is copied if the attribute holds multiple users.
This happens because the smart value for the assets object attribute returns an array when multiple users are in the attribute.
Configure Automation to add multiple users as participants
- In your automation, create a variable where you will store the users from your assets object user attribute; in the below example, the asset attribute that stores the users is called Owners, so the smart value is {{issue.customfield_####.Owner}}
In the Edit issue action, use additional fields and JSON along with list smart value operations to update the field:
JSON{ "update": { "Request participants": [ {{#Participants.substringBetween("[","]").split(", ")}} { "add": { "accountId": "{{.}}" } } {{^last}},{{/}} {{/}} ] } }
- In this example, we're updating the 'Request Participants' field, and our variable is called Participants; make sure to change it to match your environment.