Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I am getting an error while creating a request in JIRA service desk as XSRF check failed. Edited

I 'm trying to hit a create issue request using docs here :

Jira REST API examples (atlassian.com)

SO far I'm able to get project ID and key then issue type ID succesfully.

But as soon as I'm trying to create an issue using below JSON body

{
"fields": {
"project":
{
"id": "TER"
},
"summary": "No REST for the Wicked.",
"description": "Creating of an issue using IDs for projects and issue types using the REST API",
"issuetype": {
"id": "11112"
}
}
}

 

I'm getting a response saying "XSRF check failed"

As per the documentation available here : XSRF check failed when calling Cloud APIs | Atlassian Cloud | Atlassian Documentation

I have added the header 

X-Atlassian-Token: no-check

but the issue remained same 

URL - POST :  http://<mydomain>.atlassian.net/rest/api/2/issue/ 

Authorization is basic - Username and API key as password

Headers - Content-Type" : "application/json"

Please note : I'm using postman for the testing.

Am I missing something ? I have a site admin and project administrator permissions.

1 answer

1 accepted

0 votes
Answer accepted
Muhammad Ramzan Community Leader Jun 09, 2021

Can you please share the Post man screen shot with request data and headers, regarding the above JSON which you shared , I found one issue there, please fix it.

If you use "Id" then provide the project id eg. 10001,1003

if you use  "Key" then you can use project key 

In above JSON you are using Id Param but the value is project key, it should be the project id.

Thanks @Muhammad Ramzan  for replyiing

So below is a snapshot of my postman headers :

Postman2.JPG

 

Thanks for your suggestion , I have changed the JSON as below :

 

{
"fields": {
"project":
{
"id": "14215"
},
"summary": "No REST for the Wicked.",
"description": "Creating of an issue using IDs for projects and issue types using the REST API",
"issuetype": {
"id": "11112"
}
}
}

 

But it's still same

Muhammad Ramzan Community Leader Jun 09, 2021

Thanks for sharing the image, can you please replace http with https and then try

Thanks @Muhammad Ramzan , It worked successfully. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

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