Could anyone help me troubleshoot the Jira automation error when using JSON to update a custom multi user picker field?
Destination field: "Code reviewers" - a custom multi user picker field
Source data: pull request details from Bitbucket (from log, there are 2 reviewers)
JSON:
{
"fields": {
"customfield_xxx": [
{{#webhookData.pullrequest.reviewers}}
{
"{{account_id}}"
}
{{/webhookData.pullrequest.reviewers}}
]
}
}
Issue got resolved with below JSON, finally.
{
"fields": {
"customfield_xxx": {{webhookData.pullrequest.reviewers.account_id.asJsonObject("accountId").asJsonArray}}
}
}
I guess the reasons of the error are 1) "accountId" other than "id" should be used; 2) Bitbucket returns "account_id" other than "accountId", so have to use asJsonObject() to convert the parameter name, see below message in code block; 3) for fields that take an array of single field object: should use the JSON documented here.
Log of Bitbucket reviewers: [{ "account_id": "712020:xxxx" },{ "account_id": "712020:xxx" }]
Hi @Amy Hu
I have a similar requirement but in Jira Data center.
I want to update (add and remove) the user picker (multi user) custom field via automation rule JSON.
Can you please help with this.
As of now I have tried the following -
{
"update": {
"customfield_10439" :
[{
"add": {
"accountId":"xxxxxx"}}
]
}
}
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.