I'm trying to make a post request to perform a transition (transition issue to Done), but it keeps giving me a 403 error. I don't think this is a permissions error (ironically), as I am able to make GET requests with the same Auth info, and I can make the exact POST request via CURL just fine. What is it about making the POST request through AJAX that causes the 403?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Dustin,
you have to add headers:
"Content-Type", "application/json"
"accept", "application/json"
"X-Atlassian-Token", "nocheck"
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Thomas Deiler, I tried those headers, still getting same response. According to this article: https://confluence.atlassian.com/cloudkb/xsrf-check-failed-when-calling-cloud-apis-826874382.html, you can't make XSRF protected requests through the browser. Do you think that's the case here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Dustin,
the article describes exactly the case with the REST Api. They just add the third header and leave the others away. Can you check this?
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note that this is only available for requests made by command line tools
or external systems, not browser requests. This is because the
Cross Origin Resource Sharing specification does not allow JavaScript
loaded in third party websites to set arbitrary request headers.
So this only helps for CURL, not Javascript code? Because it does work with curl. Or am I missing something @Thomas Deiler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Dustin,
this has nothing to do with curl or anything else. Regardless with which library you communicate with the REST API, you have to follow the rules of the API - that's same for all. Otherwise it wouldn't be an API.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
const httpClient = await addon.httpClient({ addon: addon, clientKey: '5d5659b6-09f0-3482-bfa2-0405c4818f1e' });
httpClient.del({ url: 'rest/api/3/project/10002',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-Atlassian-Token': 'nocheck' } },
(err, response, body) =>
{ res.send(`body = ${body}`); });
//403
The same, I can get data using get request
const httpClient = await addon.httpClient({ addon: addon, clientKey: '5d5659b6-09f0-3482-bfa2-0405c4818f1e' });
httpClient.get('rest/api/3/mypermissions', function (err, response, body) { res.send(`body = ${body}`); });
//success
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any updates on this one? I'm running into the same thing. I'm able to get my POSTs working v ia Postman, but I'm trying to create a Microsoft Flow connector and it keeps throwing the XSRF check failed error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Brandon Miller and @zzw8200465323 ,
can you please post the JSON dump that is sent to Jira, that is causing the problems?
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@zzw8200465323 good! With your link information the question seems to be answered. Can you mark it?
Thanks
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.