Jira automation: using "Edit issue" to update a custom field via "Advanced fields" box

vincentt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2022

Hello, I am working on an automation within Jira to try and update a custom field. 

The custom field does not appear in the drop-down box so I have to try and figure out the JSON, but I can't wrap my head around it.

My Googling leads me to think the below JSON is correct:

{
"fields": {
"customfield_10458": "My new value"
}
}

But it doesn't work and Jira reports this error when the rule is run:

Can not instantiate value of type [simple type, class com.atlassian.jira.issue.fields.rest.json.beans.CustomFieldOptionJsonBean] from JSON String; no single-String constructor/factory method (customfield_10458)

I have no idea what this means. 

The custom field in question is a "Dependant dropdown", but I don't know if that is important or not.

I've been looking at this document plus a few other support tickets on here but haven't found a solution to my problem.

2 answers

1 accepted

0 votes
Answer accepted
Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2022

@vincentt ,

 

What is the type of custom field you are looking to update? 

According to the type of field you need to mention the JSON object

Refer this  for more info

vincentt
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2022

The custom field type here is a "Dependant dropdown". That's how it appears in the "Issue types" page in Jira. 

In the document you mentioned it appears to be shown as a "Cascading select custom field". 

This inconsistency probably explains why my searching was a bit fruitless.

After messing around with it a bit more I have landed on the JSON below which is working:

{
"fields": {
"customfield_10458": { "value": "My new value" }
}
}

Note: in this particular use case this particular "parent" has no associated "child" values (but other parents in the dropdown do).  

Thanks for your help!

0 votes
Sachin Dhamale November 4, 2022

@vincentt ,

 

What is the type of custom field you are looking to update? 

According to the type of field you need to mention the JSON object

Refer this  for more info

 

Thanks,
Sachin

Suggest an answer

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

Atlassian Community Events