Hi!
I am a complete beginner to JIRA and AJAX in general. I am trying to create an issue and this is my code:
$.ajax({
type:"POST",
url: "https://jira.company.com/rest/api/2/issue",
dataType: "json",
headers: {
'Content-Type':'application/json',
'X-Atlassian-Token':'nocheck',
},
username: "username",
password: "password",
data:{
"fields":{
"project":{
"key":"AUTO"
},
"summary": "This is a trial for JIRA integration",
"description": "JIRA integration trial",
"issuetype":{
"name":"Bug"
}
}
},
success: function(){
console.log("issue logged");
},
error: function(xhr, status, error) {
alert(xhr.getAllResponseHeaders());
}
})
The problem is, I am getting an XSRF check failed error. with the following error message in chrome:
Response for preflight has invalid HTTP status code 403.
Please help. Thanks in advance.
In your curl command: -H "X-Atlassian-Token:no-check"
It should be 'nocheck' without '-'
The following command tested working in my local instance:
curl -H "X-Atlassian-Token:nocheck" -u username:xxxx 'http://<<System IP>>/rest/api/2/issue/TP-333/attachments' -X POST -F file=@<<file path>>
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.