Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation Rule/JSON not updating one custom field user with another.

Tyler Giles August 28, 2024

I have 2 custom fields, 10030 is multi user picker, and 10185 is a single user picker. I want to make an automation rule that ADDS user selected in 10185 to 10030. I need to accomplish this using JSON. This is how I have the automation rule currently:


{
"update": {
"customfield_10030" : [
{"add": {{issue.customfield_10185}}}
]
}
}

This returns error: Error while parsing additional fields. Not valid JSON.

Does anyone know how I can successfully use JSON to ADD a single user from customfield_10185 to customfield_10030? Thank you for your time!

2024-08-28_07-57-40.jpg

1 answer

0 votes
Tomasz Kowalczyk
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.
August 28, 2024

Differences between multiuser and userpicker are that first returns array of users. Maybe problem is that you're trying to pass one user but you should pass an array of one user. Is this some kind of requirment achievieng it with json?. Is there no option to set edit field and than pass there a smart value of customfield value?

Tyler Giles August 28, 2024

@Tomasz Kowalczyk Thank you for your reply! So setting the smart value works, but it REPLACES what is already in customfield_10030, while what I am trying to do is ADD 10185 to what is already present in 10030.

Tomasz Kowalczyk
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.
August 28, 2024

So maybe try too pass something like this :
"add": [ {{issue.customfield_10185}}] i'm not sure is it properly configured json but for now i don't have place to test it. 

Tomasz Kowalczyk
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.
August 28, 2024

from documentation i found this part for setting multiuserpicker


{ "fields": { "Multi User Customfield": {{issue.parent.Multi User Customfield.accountId.asJsonObjectArray("id")}} } } 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events