Hey,
I've been trying to create an Issue in Jira from Confluence via an embedded javascript file for quite a while now, but it just does not seem to work. Currently the returned error is "415 Unsupported Media Type", which according to this site
should be fixed, by adding the correct ContentType, which I did, but which did not help
here is my javascript code
let req = {
fields: {
project: {
"key": "ERM"
},
summary: "Test #00",
description: "Test #00",
dataType: 'json',
issuetype: {
"name": "Deliverable",
},
"Component/s": ["AIDA"],
Project: {
key: "ERM",
},
Vendor: {
value: "NC",
},
}
};
function init() {
$.ajaxSetup({
crossDomain: true,
contentType: 'application/xml; charset=utf-8',
xhrFields: {
withCredentials: true
},
});
$.post("../../../jira/rest/api/2/issue/", JSON.stringify(req), processData);
};
function processData(data) {
console.log(data);
};
Hopefully one of you is able to help me! Thanks in advance.
Your content type should be 'application/json' -- not xml.
While that version of Fisheye/Crucible referenced in your link may accept XML, Jira doesn't.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.