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,485
Community Members
 
Community Events
184
Community Groups

Updating single select custom field with automation for Jira

Nikki Zavadska _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 05, 2022

Hi πŸ‘‹ ,

I'm trying to create automation that updates the custom field that I created with an option from that custom field.

 

The JSON I'm using to update is:

{
"fields": {
"customfield_10121": { "value": "b" }
},
}

(I figured this based on the documentation here: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/ 

 

This is how my custom field values look like in the GET issue api:

Screenshot 2022-01-05 at 10.51.20.png

The values that are available in the dropdown for this field are a and b

 

When I run the automation I get the following error:

Error while parsing additional fields. Not valid JSON.

 

I can't see what I'm doing wrong here, I tried many options already but can't figure it out. Did anyone have a similar problem and find a solution?

2 answers

2 accepted

0 votes
Answer accepted
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 05, 2022

Hi @Nikki Zavadska _Appfire_,

The issue is your comma:

comma.png That comma should only be there if you were going to start another field.

There are some good JSON validators on the web that can help with this sort of thing too.

Cheers,

Simeon.

Bill Sheboy
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.
Jan 06, 2022

Hi @Simmo 

FYI there are several examples with stray commas in the JSON on this documentation page: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/    :^)

Thanks, and kind regards,
Bill

Like β€’ # people like this
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 06, 2022

Hey @Bill Sheboy

Thanks for the shout out re commas! I'll get that addressed! Appreciate it!

Cheers,

Simeon.

Like β€’ Bill Sheboy likes this
Nikki Zavadska _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 07, 2022

Hi @Simmo thank you for the answer! The comma confused me a little bit πŸ™ˆ.

I just noticed that for the single select field this JSON actually works πŸ‘‡
{
"fields": {
"customfield_10121": { "value": "b" }
}
}

Screenshot 2022-01-07 at 15.43.28.png

 

But for the marketplace apps generated single select field I receive the error:

(this is how the field looks like)

Screenshot 2022-01-07 at 15.45.22.png

and this is the error:

Error editing issues
PA-4 (Can not deserialize instance of java.lang.Long out of START_OBJECT token at [Source: N/A; line: -1, column: -1] (foxly__0f0af5b0-55fa-41ff-ae6f-b4c33d6c6f09-label))
Do you have any idea why that's happening? Looking at the fields information I would say I should be able to access the value same way but from some reason that doesn't work πŸ€”
Like β€’ Yatish Madhav likes this
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 09, 2022

Hey @Nikki Zavadska _Appfire_

So this is a fun one, but lets see what we can figure out.

Its saying cannot deserialize a long out of start object. Translation, I expected a number but got a complicated object. So, for these I think you should try just specifying an id like so:

{
"fields": {
"customfield_xyz": 4
}
}

Or, if you're using smart values:

{
"fields": {
"customfield_xyz": {{someSmartValue}}
}
}

Cheers,

Simeon.

Nikki Zavadska _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 11, 2022

Thanks @Simmo ! When trying to store id directly it works, so I guess there isn't any way to store "Value" via Automation for Jira, only via "id" in this case. Do I understand it correctly?

Like β€’ Yatish Madhav likes this
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jan 11, 2022

Hi @Nikki Zavadska _Appfire_,

I think for some reason marketplace custom fields behave a bit different, I can't tell you why, so yes, i think you'll have to do it via id rather than value.

Cheers,

SImeon. 

Like β€’ # people like this
Nikki Zavadska _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 12, 2022

Thank you for clarifying @Simmo πŸ™πŸ™

Like β€’ John Funk likes this

Apologies - guess my post is a duplicate of what @Nikki Zavadska _Appfire_  is trying to achieve (https://community.atlassian.com/t5/Jira-Service-Management/Trying-to-edit-select-field-with-Value-not-ID/qaq-p/2153992)

Is there any plan from Atalssian to support this or any sort of workaround? Thank you

Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 04, 2023

I'm afraid I don't know @Yatish Madhav 

This isn't in my area of expertise.

Like β€’ Yatish Madhav likes this
0 votes
Answer accepted
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 05, 2022

Hi @Nikki Zavadska _Appfire_ 

It's working fine, give the actual custom field name

{
"fields": {
"Radio Button": {
"value": "2"
}
}
}

Thanks,
Pramodh

Nikki Zavadska _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 07, 2022

Hi @Pramodh M

thank you so much for your answer! You can actually use both - custom field name or id in Automation for Jira, the problem was the comma that was also mentioned in the Atlassian documentation.

Suggest an answer

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

Atlassian Community Events