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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,507
Community Members
 
Community Events
184
Community Groups

JSON for updating people picker field from text field of ID

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

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