I'm currently attempting to create a new issue, and either using curl or a python script I've been working on I get the following error (token depends on data it seems):
<Response [400]> {"errorMessages":["Unrecognized token 'filsdsrpinfed': was expecting 'null', 'true', 'false' or NaN\n at [Source: org.apache.catalina.connector.CoyoteInputStream@12aa9c; line: 1, column: 27]"]}
The JSON I'm attempting to use is below, and as far as I can tell it's formatted correctly, and has all of the required fields for creating the issue.
payload = { "fields": { "project": {"key": "TST"}, "summary": "Testing API creation", "description": "Creating of an issue using project keys and issue type names using the REST API", "issuetype": {"key": "Bug"}, "reporter": {"type": "JenkinsJIRABot"}, "customfield_10400": {"value":"Undefined"} } }
I'm using the user/pass validation if that makes a difference, can anyone help me resolve this problem? Thanks.
Figured it out, JSON whitespace was the culprit, was not properly removing it before sending.
What kind of JSON whitespace are you talking about? I get an identical kind of error, on a different API call and I am wondering what is the cause. The posted data is a valid JSON as I generated it with json.dump(). Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used json.dumps() on payload before passing it to request and it solved the issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
json.dumps() for the win!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you guys!
Helped me with json.dumps() !
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.