I am preparing a PowerShell script to generate an issue. The error I got is:
"errorMessages":[],"errors":{"Application":"data was not an array"}}
The "Application" field (customfield_11040) is a dropdown menu allowing multiple selection. The values are "HR system","IT system","Purchasing system" etc.
My Powershell compose the json body like below:
$messageBody = @{
fields = @{
project = @{
key = "IT"
}
summary = "test create issue"
description = "Creating of an issue using project keys and issue type names using the REST API"
issuetype = @{
name = "Bug"
}
customfield_11043 = @{
name="test"
}
#application field
customfield_11040 = @{
Application="HR system"
}
}
}
Please advice how can I check the structure of customfield_11040?
Hello,
You can find an answer here:
There are examples for all custom field types.
How can I get customfield_11040's field type?
The error returned is weird
":{"Application":"data was not an array"}}
it is not returning :
":{"customfield_11040":"data was not an array"}}
Also, I tried to input the data as "array" . Is the error trying to tell me I should not use Array?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It means that you did not provide an array. I gave an example, can you provide here your final json?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is part of JSON I "post" to JIRA:
"description": "Creating of an issue using project keys and issue type names using the REST API",
"customfield_11040": {
"id": "11521"
},
and error returned:
{"errorMessages":[],"errors":{"Application":"data was not an array"}}
Then I have another try with follow JSON:
"customfield_11040": "[ {\"value\": \"EPM\" }, {\"value\": \"ADM\" }] ",
and error returned exactly the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your JSON should be like this:
{"fields":{"customfield_11040": [ {"value": "EPM" }, {"value": "ADM" }]}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Posted an update here as well related to this: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/PHP-REST-API-and-Multi-checkboxes/qaq-p/325853#U1430338
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I print out the JSON structure for my POST:
{
"fields": {
"issuetype": {
"name": "Bug"
},
"description": "Creating of an issue using project keys and issue type names using the REST API",
"customfield_11040": {
"application": "HR system"
},
"customfield_11043": {
"name": "test"
},
"summary": "test create issue",
"project": {
"key": "TEST"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.