Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

XSRF check failed with jQuery

Marcelo Araujo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 4, 2018

Hello.

I'm trying to create an issue but it returns the "XSRF check failed" error.

I'm using the following code:

$.ajax({ 
async: true,
crossDomain: true,
url: 'https://testejiraloupen.atlassian.net/rest/api/2/issue',
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa('email:pass'),
'Content-Type': 'application/json',
/*'X-Atlassian-Token': 'nocache',*/
'Access-Control-Allow-Origin': '*',
'Access-Control-Alow-Methods': 'POST, GET, PUT, OPTIONS, DELETE',
'Access-Control-Max-Age': '3600',
'Access-Control-Allow-Headers': 'x-requested-with, content-type'
},

processData: false,
data: JSON.stringify(issue),
success: function(data) {
console.log('Issue created. Id >>> ' + data.id);
},
error: function(err) {
console.log(err);
}

});

 Can anyone help me in this case?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events