Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,297,849
Community Members
 
Community Events
165
Community Groups

Unable to create JIRA issue from Confluence

P S I'm New Here May 02, 2022

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.

Approach 1

 

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).

 

Approach 2 

 

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:

  1. exceptionName"com.atlassian.integration.jira.JiraCommunicationException"
  2. message"The server may be unreachable. Please ensure you are running Jira 5.0 or higher."

 

Any help appreciated.

Thanks.

1 answer

1 vote
Srinatha T Atlassian Team May 02, 2022

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

93 views 0 0
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you