Create issue via POST

douglas cotta August 10, 2011

I am trying create issue via HTTP POST with the url: http://127.0.0.1:8080/secure/CreateIssueDetails.jspa?pid=10000&issuetype=1&summary=My+Test+Issue&os_username=admin&os_password=admin

But I am receiving the message:

XSRF Security Token Missing

JIRA could not complete this action due to a missing form token.

What I have change in my url or in my jira configuration?

Thanks!

2 answers

1 accepted

5 votes
Answer accepted
Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2011

This is protection against cross-site request forging. A form would pass "atl_token" parameter, which you can first read by loading CreateIssue.jspa page.

However, if you're POSTing from code, you can add {{X-Atlassian-Token: no-check}} header.

See here: http://confluence.atlassian.com/display/JIRADEV/Form+Token+Handling

douglas cotta August 14, 2011

But as should be the url of the post, I tried in various ways by adding the parameter "atl_token" and does not work. It only works by disabling the token?

best regards,

Igor Sereda [ALM Works]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 15, 2011

If you are sending HTTP POST, then URL does not contain any parameters - they are send as the content after request headers.

douglas cotta August 17, 2011

I can upload attachments via HTTP POST? If yes, I can do this in the same post of the issue create?

Best regards,

0 votes
khattaksd September 15, 2011

You may disable token checking via the properties files as mentioned in the Jira documentation (a restart of the server will be required to take effect).

Alternately, you can pre-populate the form and the let the authenticated user verify / create the issue.

To do this, post your form like so:

<form action="{jira-base}/secure/CreateIssueDetails!init.jspa" target="_blank" method="post">
		<input name="pid" value="10060" type="hidden">
		<input name="issuetype" value="6" type="hidden">
		<input name="assignee" value="-1" type="hidden">
	        <input name="reporter" value="someuser" type="hidden">
		<input name="description" value="description" type="hidden">
		<input name="priority" value="3" type="hidden">
		<input name="components" value="10340" type="hidden">
		<input name="fixVersions" value="10312" type="hidden">
		<input name="summary" value="some summary " type="hidden">
		<input value="ACTION REQUEST" type="submit">										
</form>

Suggest an answer

Log in or Sign up to answer