Forums

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

Create JIRA Issue with REST API via vrops error code 400

cherdsit_t
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 17, 2020

jira.JPG

 

Create JIRA Issue with REST API via vrops error code 400

 

Header Content-Type  application/json

-----------------------------------------------------

Boby

 

{
  "fields": {
    "project": {
      "key": "ISD"
    },
    "summary": "fix invalid HTML or missing opening",
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "text": "Sample description",
              "type": "text"
            }
          ]
        }
      ]
    },
    "priority": {
      "name": "Low"
    },
    "customfield_10083": "fix invalid HTML or missing opening",
    "issuetype": {
      "name": "Email request"
    }
  }
}

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2020

Hello @cherdsit_t ,

Thanks for reaching out, and looking at the screenshot and the details you provided I think the conflict might be on Jira API vs Service Desk API for create issue options.

First you have this question flagged with a jira-service-desk-cloud tag, which is where I am pulling this assumption from so please correct me if this is not the case. 

But, looking at the the screenshot in particular it cut off and I cannot see the full end point you're performing the POST on but it looks like you're doing a POST to the create issue dialogue via a POST /rest/api/3/issue, but creating a customer request in a service desk project would be to the endpoint POST /rest/servicedeskapi/request, and the call and body should look more like the EXE from that second link for creating a customer request: 

curl --request POST \
--url 'https://your-domain.atlassian.net/rest/servicedeskapi/request' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requestParticipants": [
"qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d69abfa3980ce712caae"
],
"serviceDeskId": "10",
"requestTypeId": "25",
"requestFieldValues": {
"summary": "Request JSD help via REST",
"description": "I need a new *mouse* for my Mac"
}
}'

If this is not the case can you let me know the endpoint you're hitting, and the project type.

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events