I'm trying to use jira-python (plus some of my own scripts) to add users to a group. I keep getting an XSRF Token Missing error. I found this https://developer.atlassian.com/display/JIRADEV/Form+Token+Handlingbut my Java knowledge isn't strong enough to figure out how to Pythonize it, if that's even the right way to go.
If it tells you the XSRF token is missing, that means you're posting your data as a form. Can you show us the python code you're using for that?
Instead of posting a form, you should try to post json data:
The result should be similar to the code sample which is next to the green tick on this page: http://stackoverflow.com/questions/9746303/how-do-i-send-a-post-request-as-a-json
The drawback is, it's up to the JIRA code you're targetting to accept to switch between JSON or forms, so we need to know which url you're targetting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry I'm more expert with Confluence, but XSRF tokens are only useful when you POST a form. If you POST a JSON content, you shouldn't need it. Does it work if you use JSON instead of a form?
For the background knowledge, XSRF tokens only exist because it's possible to post an html form to another website, whereas it wouldn't be possible in Javascript because it would be a cross-site request.
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.