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"
}
}
}
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"
}
}
}
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
},
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.