This error message is straightforward but I am stumped on how to get around it.
I have a custom field of region. The custom field ID is customfield_29780. On the UI itself, Region is a handful of checkboxes.
Looking at the JSON for the customfield definition itself (createmeta), I see the following:
"customfield_29780": {
"required": false,
"schema": {
"type": "array",
"items": "option",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes",
"customId": 29780
},
"name": "Region",
"hasDefaultValue": false,
"operations": [
"add",
"set",
"remove"
],
The only other custom field I have is ‘Category’, and since that is a plain string it works fine. That has a customfield ID of 11580.
issueData.Add("customfield_11580", new { value = issueFields.Category });
issueData.Add("customfield_29780", new { value = issueFields.Region });
Do note that issueData is defined like so:
var issueData = new Dictionary<string, object>();
I set the ‘Region’ attribute in the IssueFields model like so:
String[] Region {get; set;}
I’ve also tried a List<> data type but no luck with that. Same error message of ‘data was not an array’.
Is there something I’m overlooking here? Even if I call GetType() on Region I can see in the logs that it is indeed System.String[].
Logging the JSON output I see the following:
"Category": "Test Category",
"Region": [
"California"
],
"summary": "test summary"```