XSRF check failed while creating issue with Jquery JIRA REST API

I am a complete beginner to JIRA and AJAX in general. I am trying to create an issue and this is my code: 

url: "https://jira.company.com/rest/api/2/issue",
dataType: "json",
headers: {

username: "username",
password: "password",
"summary": "This is a trial for JIRA integration",
"description": "JIRA integration trial",
success: function(){
console.log("issue logged");
error: function(xhr, status, error) {

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. 

1 answer

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

But I did use nocheck without hyphen in my ajax query 


And I am not even using CURL . I am using JS. 


Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Mar 17, 2018 in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

615 views 6 10
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot