Forums

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

Add user who transitioned issue to a multi user picker custom field

Deleted user April 11, 2022

We have a multi picker user field called Stakeholders.  After an individual transitions a ticket through the workflow, we would like them added to the stakeholder list.  We use Jira Cloud.  I have tried multiple ways with using the assignee or the initiator to custom field.  I tried with both post functions and automation and have been unable to be successful.  My last attempt was the following in Jira automation:

 

When issue transitioned:

Edit Issue fields

Stakeholders

{
"fields": {
"Stakeholders": [{
"add": "{{assignee.accountId.asJsonObjectArray("id")}}"
}]
}
}

This says it is successful but the field is still empty.   Any help?

1 answer

0 votes
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.
April 15, 2022

Hi @[deleted] 

The function asJsonObjectArray() is not finding the "id" key as you have already dereferenced to accountId, and so it returns null.

Please try with {{initiator}} and instead of going to the accountId attribute first, convert to JSON and then replace the key.  Something like this:

{{initiator.asJsonObjectArray("accountId").replace("accountId", "id")}}

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events