I am trying to create an issue using Jira REST API on Postman, Getting status 415 Unsupported media
Asked by AI:

Solution : Changed the Content-type in headers text/html to application/Json for this error code 415, Issue has been fixed.

Details : I am using limited fields which are there in Create screen,

Requirement : Create issue in Jira and Create Link for another issue type

Here is my Payload :

{  
"fields":{  
"project":{  
"key":"APPI"  
},  
"summary":"Test_Postman1",  
"description":"Test description",  
"Priority":"High",  
"issuetype":{  
"name":"Task"  
},  
"assignee":{  
"name":"XYZ"  
},  
"reporter":{  
"name":"Anna",  
"customfield_10010":"Start a New Portal Issue Ticket"  
}

}  
}


Answers:
author: Kalyan Sattaluri
body: I was able to post and create using below request.

Maybe try small first and add elements slowly.

In browser, Open Jira, take a sample issue key, go to new browser tab, replace bolded below / paste / hit enter / review response on how object is structured and add items slowly to make sure they are working as you go along:

https://**yourdomain** .net/rest/api/2/issue/**ABCD-1234**?expand=names

{  
"fields":{  
"project":{  
"key":"APPI"  
},  
"priority": {  
"name": "High"

},  
"summary":"Test_Postman1",  
"description":"Test description",  
"issuetype":{  
"name":"Task"  
}

}  
}

comments: author: AI
body: I am getting the response and added items as per the structure, still getting the same.


author: Kalyan Sattaluri
body: Are you sure what ever you are passing as assignee name is what Jira is expecting?

Because every Jira set up is different, we cannot tell you correct JSON.

When creating a task in UI, see whats the bare minimum fields it needs, simply put that to begin with and confirm if that works.

I would especially remove the assignee part for now as system defaults to Project Lead's name anyways.


author: AI
body: I have removed the assignee and Custom field too, the Custom field : Request type in JSM and Required, I have removed that too however getting same.

{  
"fields":{  
"project":{  
"key":"NP"  
},  
"summary":"Test_Postman1",  
"issuetype":{  
"name":"PR"  
},  
}  
}


author: Kalyan Sattaluri
body: I just tested below JSON and it worked..

Also share what response you are getting trying below version.

{  
"fields":{  
"project":{  
"key":"**SUP** "  
},  
"priority": {  
"name": "High"

},  
"summary":"Test_Postman1",  
"description": {  
"type": "doc",  
"version": 1,  
"content": \[  
{  
"type": "paragraph",  
"content": \[  
{  
"type": "text",  
"text": "description"  
}  
\]  
}  
\]  
},  
"issuetype":{  
"name":"Task"  
}

}  
}

Also, Please review sample structure in below link:

<https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post>


author: AI
body: ![Screenshot 2024-03-27 201419.png](https://community.atlassian.com/t5/image/serverpage/image-id/315003iB90B7002CB3DF23F/image-size/large?v=v2&px=999 "Screenshot 2024-03-27 201419.png")I have tried with Request type and without request type which is mandatory field but still it's same


author: AI
body: ![Screenshot 2024-03-27 202045.jpg](https://community.atlassian.com/t5/image/serverpage/image-id/315004iBEC2C3C853614D44/image-size/large?v=v2&px=999 "Screenshot 2024-03-27 202045.jpg")

Here is my Issue create page. Does it required any Api permission to get into Jira JSM, I have a Administrator role.


author: Kalyan Sattaluri
body: Please cross check what you have for content-type in your header, should be application/json

See below:

<https://community.developer.atlassian.com/t/post-api-call-return-error-415/62992>


author: AI
body: Grate! its worked, Content type was text/html changed to application/Json.

I am trying to add all fields.

Thanks again!


author: Kalyan Sattaluri
body: Uff. We shoudl have checked that first. But glad we have a beginning.

Can you please update your first post that the solution was to change content-type for this error code and mark this answer accepted so that folks in the future can quickly get to the answer so they dont waste time like we did.. lol.. Thanks!


author: AI
body: I should have been check that, Updated Thanks!


author: AI
body: [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306)Could you please assist me on this issue

<https://community.atlassian.com/t5/Jira-Service-Management/Create-issue-and-link-with-existing-issue/qaq-p/2659063>


Tags: cloud

jira-service-management

jira-service-management-cloud