Hello,
I've spent a lot of time trying to get this to work, but no luck.
My goal is from Confluence to create JIRA issues using the JIRA API.
I've tried the 2 approaches below, each of them returning their own errors. At this stage I'm not sure if its due the request I'm making or our JIRA setup (and fyi I have no access to the JIRA/Confluence admin settings, I'm just a user).
In both approaches I have a Confluence page with a HTML section in which I have the following code.
let reqData = {
"project": {
"id": "1001"
}
// some more fields here, just simplifying
}
function createMCC() {
jQuery.ajax({
type: "POST",
url: 'https://<MY_CONFLUENCE_URL>/plugins/servlet/applinks/proxy?appId=<JIRA APPID>&path=https://<MY JIRA URL>/rest/api/latest/issue',
data: JSON.stringify(reqData),
contentType: "application/json; charset=utf-8",
processData: false,
headers: { 'X-Atlassian-Token': 'no-check', 'Accept': 'application/json', 'Content-Type': 'application/json' },
dataType: "json",
async: false,
success: function (data) {
console.log(data)
},
error: function (data) {
console.log(data)
}
});
}
This returns a 400 response with the error:
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).
let reqData = {
issues: [{
"project": {
"id": "1001"
}
// some more fields here, just simplifying
}]
}
function createMCC() {
jQuery.ajax({
type: "POST",
url: 'https://<MY CONFLUENCE URL>/rest/jira-integration/latest/issues?applicationId=<JIRA APP ID>',
data: JSON.stringify(reqData),
contentType: "application/json; charset=utf-8",
processData: false,
headers: { 'X-Atlassian-Token': 'no-check', 'Accept': 'application/json', 'Content-Type': 'application/json' },
dataType: "json",
async: false,
success: function (data) {
console.log(data)
},
error: function (data) {
console.log(data)
}
});
}
Returns a 500 response with the error:
exceptionName: "com.atlassian.integration.jira.JiraCommunicationException"
message: "The server may be unreachable. Please ensure you are running Jira 5.0 or higher."
Any help appreciated.
Thanks.
Hi @P S ,
Welcome to Atlassian community.
You are using the cloud version or server ? I have very basic knowledge on API's , so other community members might help with above errors.
For server we had this article which has some example code for you. We have some other ways of creating issue's from confluence and you might want to refer the below URL
Have a good day!
Thanks,
Srinath T
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.