Jira api. Send POST - "{\"errorMessages\":[],\"errors\":{\"Concession\":\"data was not an array\"}}"

javier May 13, 2022

Hi,

I have to send a json to the jira api to create a ticket/issue.

Url api: https://mydomain.net/rest/api/3/issue

I add key and required fields of the project.

 

I have this field in my Jira tickets when I look into the XML file to see the structure ad fields:

....

<customfield id="customfield_10020" key="com.atlassian.servicedesk:vp-origin">
      <customfieldname>Request Type</customfieldname>
       <customfieldvalues> </customfieldvalues>
</customfield>

.....

1. The field "customefield_10020" features: are as follows:

name: Request Type

3 values: 

1. Request

2. Done

3. Question

 

The json below gives me an error:

{

    "customfield_10020": "Request",

}

error.

[\"Request Type: Invalid client request value\"],\"errors\":{}}

 

2. And if a I my json for this field is

}

"customfield_10020": {
                "key": "customfield_10020",
},

 

It gives this error:

"{\"errorMessages\":[],\"errors\":{\"Concession\":\"data was not an array\"}}"

 

 

What json format should I send for this field customized?. I'm confused

Thanks

 

 

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2022

Hello @jg ,

Thanks for reaching out, and looking at the error response this is hanging up on the request type indicating the project type is Jira Service Management, and the endpoint that you are using is the create method for Jira Software.

Jira Software and Jira Service management have different approaches and requirements for creating issues.

The endpoint you want to look at is "Create customer request" via:

Regards,
Earl

javier June 9, 2022

Thanks for the anwser,.

That means I have to wite my json like this:

"customfield_10020": [

{
               "key": "customfield_10020"

}]

 

However, the field customfield_100020 is a type "requestType", so can I values to a "requestType" from the endpoint https://mydomain.net/rest/api/3/issue or https://mydomain.net/rest/api/2/issue?

What would it be the json?, ie, or some fields are left?

"customfield_10020": [

{
               "serviceDeskId": "2",

               "requestTypeId": "98",

}]

 

Thanks

Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 13, 2022

Hello @jg ,

Modifying the Request Participant is done entirely from the Service Management API

Adding a request participant to a request in the Service Management API is done via the endpoint:

And Removing a request participant is done via:

Regards,
Earl

Suggest an answer

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

Atlassian Community Events