Forums

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

data was not an array

Rahim T_S
Contributor
February 28, 2023

I'm trying to create an issue via rest API to out custom Jira and one of the custom field require an array as input

I didn't quite understand how to pass data as an array so I listed all the fields available and checked an existing issue by exporting it as xml

from listing all the custom fileds

 

  {
    "id": "customfield_15500",
    "name": "<redacted>",
    "custom": true,
    "orderable": true,
    "navigable": true,
    "searchable": true,
    "clauseNames": ["cf[15500]", "Test <redacted>"],
    "schema": {
      "type": "array",
      "items": "option",
      "custom": "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes",
      "customId": 15500
    }
  },

and from the issue that was exported as XML

{
"customfieldname": "<redacted>e",
"customfieldvalues": {
"customfieldvalue": {
"__cdata": " Not Available in the list "
}
}
},
How it looked as XML

<customfield id="customfield_15500" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
<customfieldname>redacted</customfieldname>
<customfieldvalues>
<customfieldvalue key="17163">
<![CDATA[ Not Available in the list ]]>
</customfieldvalue>
</customfieldvalues>
</customfield>


How can I add this custom filed using rest API ?



while I try I get

"errors":{"<redacted>":"data was not an array"}}


What is the general format of in jira for custom fields when data should be an array ?

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer