Missed Team ’24? Catch up on announcements here.

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

JSON for updating people picker field from text field of ID

Marc Isikoff May 1, 2023

I am trying to automate a people picker custom field that if used on the request form, allows a user to type in name or ID and resolves to the person.

We need to correct the field since we see 35% of them are incorrectly filled and we have a pure text field (custom) pulled from a system.

I believe the pulled text field is the "ID" for the people picker but at first trying to automate in JSON we get a casting error.

I tried to follow posts in the community but often the situation is different so here is the code I'm trying to use: 

 

Note: 123456 is the people picker field; 654321 is the text field we've retrieved to update it...this is failing under: "Error while parsing additional fields. Not valid JSON."

{
"update" : {
       "customfield_123456" : {{ issue.customfield_654321.asJsonStringArray }}
                 }
}

1 answer

0 votes
Marc Isikoff May 1, 2023

When I switch this to:

 

{
"fields" : {
        "customfield_123456" : {{issue.customfield_654321.asJsonObject("key")}}
               }
}

I no longer get an error in automation; the audit says "Success"; however the people picker field (customfield_123456) is still empty.

To be sure, the customfield_654321 does have a value in it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events