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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.