Unable to create Issue Using JIRA API

Amit Saxena March 8, 2022

Hello Team,

I am trying to create Issue using provided API in JIRA documentation but it doesn't seems to be working.

Though I have made minimum payload but used to get error as:

{
"errorMessages": [
"The issue no longer exists."
],
"errors": {}
}
Payload:
{
"update": {

},
"fields": {
"summary": "Main order flow broken",
"parent": {
"key": "RAL"
},
"issuetype": {
"id": "10102"
},
"project": {
"id": "10100"
},
"description": "Order entry fails when selecting supplier."
}
}
Let me know If I am doing something wrong

1 answer

1 accepted

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2022

Hi @Amit Saxena ,

welcome to the Atlassian community!

I think that you are passing wrong fields to the REST api. Take a llok to the following guide https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-create-issue-7897248/

In particular, "parent" param should be used just if you need to create a subtask and parent should contain the parent issue key. 

The correct params should be the following:

{ "fields": { "project": { "key": "TEST" }, "summary": "REST ye merry gentlemen.", "description": "Creating of an issue using project keys and issue type names using the REST API", "issuetype": { "name": "Bug" } } }

Hope this helps,

Fabio

Amit Saxena March 8, 2022

Thanks Fabio.

I was following https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post

Can see the key mismatch.

http://hostname.com/rest/api/2/field/customfield_10300/option where I was trying to add option items for custom single select field but getting 

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<status>
<status-code>404</status-code>
</status>
Is there a different developed doc I have to follow??
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2022

Hi @Amit Saxena ,

it seems that there are no Rest api for this https://jira.atlassian.com/browse/JRASERVER-36112

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events