The Confluence and JIRA are connected with an application link. (servers)
Developing Built in Macros for confluence.
jQuery GET works fine, PUT and POST fails with 400.
I succeed with similar call from postman.
Permissions, logins - everything checked.
I know that there are plugins to solve this, but then I loose control of exact behavior.
Example code - trying to modify an issue summary in JIRA
var theurl = encodeURI(confbase + "/plugins/servlet/applinks/proxy?appId=" + confproxy +"&path=" + jirabase + "/rest/api/latest/issue/SP-4");
var thePost = JSON.parse('{ "update": { "summary": [{ "set": "Modified Summary 2" } ] } }');
var jqxhr = jQuery.ajax({
type: "PUT",
url: theurl,
dataType: 'json',
data: JSON.stringify(thePost),
cache:false,
async: false
}).done(function (response) {
alert("Success");
}).fail(function(jqxhr, textStatus, errorThrown) {
var contentType = jqxhr.getResponseHeader("Content-Type");
var responseBody = jqxhr.responseText;
console.log(responseBody);
alert("Failed");
});;
Response when attempting:
HTTP method PUT is not supported by this URL
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
Apache Tomcat/9.0.19
Other PUT and POST problems encountered with confluence property:
https://community.atlassian.com/t5/Jira-questions/Create-modify-confluence-property-through-REST-API-fails/qaq-p/1216072#M388269
Confluence server 6.15