Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting different JSON structure for different custom field values

Brad Hayes December 13, 2019

I have a custom field which is a checkbox.  This also happens for a selection field that has options of None and Yes.

If it is unchecked, in the REST API for the Issue I get

 "customfield_11025": null,

If it is checked I get

 "customfield_11025": [
{
  "self": "https://dmsidmsi.atlassian.net/rest/api/2/customFieldOption/10504",
  "value": "Canceled",
  "id": "10504"
}
],

 This makes it impossible to define a structure to capture the JSON into.  Regardless of which way I code it, when I encounter the opposite my progam panics because it doesn't match the defined structure.

1 answer

0 votes
Michael Raj July 30, 2020

Hi @Brad Hayes ,

add "if" and check if value is null. Now you can build structure for both options.

 

Best,

Michael

Brad Hayes August 3, 2020

Thanks Michael.  I was able to make it work doing that, but I was also curious why I was getting different values for different fields that according the administrator were both boolean values.  Seems there's multiple ways to define fields and they produce different results.

brad

Like • Michael Raj likes this

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, aafp, jira migration, marketing collaboration, end siloed work, streamline workflows, kerrie gottschalk, jira cloud admins, unified marketing, process visibility, team efficiency, cross-team collaboration

How Kerrie Gottschalk unified AAFP’s marketing team with Jira

At the American Academy of Family Physicians, siloed marketing teams faced delays and duplicate work. Kerrie Gottschalk shook things up by moving the department to Jira, streamlining processes, boosting visibility, and sparking stronger collaboration.

Read the story
AUG Leaders

Atlassian Community Events