I am attempting to create a Jira Issue from the confluence user macro. In this macro I am using jQuery to post to my Jira Instance. I am using the application links to do this and when I do I get a 411 error (length required).
var baseUrl = "https://www.my-confluence.co.uk/plugins/servlet/applinks/proxy?appId=MY_ID_NUMBER&path="
var createIssue = "https://www.my-jira..co.uk/rest/api/2/issue";
var datos = {
"fields": {
"project":
{
"key": "TEST"
},
"summary": "Test Ticket",
"reporter": "me.name",
"issuetype": {
"name": "Task"
},
}
};
var parameters = JSON.stringify(datos);
jQuery.ajax({
url: baseUrl + createIssue,
type: 'POST',
dataType: 'json',
contentType: 'application/json',
data: parameters ,
processData: false,
async: false,
success: function (data) {
alert(JSON.stringify(data));
},
error: function(error){
alert(JSON.stringify(error));
}
});
I have tried many things to try to get this to work. I have use just basic authentication instead of the application link and that also does not work, however it raises a different error to 411. Any help would be greatly appreciated.
Figured it out in the end. Had to reverse engineer the confluence macro to add a Jira Issue, the application link URL in my old code does not work. The following code should work:
Query.ajax({
url: 'https://my-confluence.co.uk/rest/jira-integration/1.0/issues?applicationId=YOUR_ID,
type: 'POST',
dataType: 'json',
contentType: 'application/json',
data: parameters,
processData: false,
async: false,
success: function(data) {
alert(JSON.stringify(data));
}
error: function(error) {
console.log('Error');
}
});
Hi
Please let me know how I can get applicationId = YOUR_ID
thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Spencer Robertson
I'm not a coder & I'm technically novice to coding. Yet I feel i can give you some points which might help you in attaining your requirements. Yet i'm not sure how good this will hold:
The required fields Date of First Response and Time in Status are not available. If you can come up with some script to include these , I guess you might be able to take it up .
Regards.
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.