Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

"errorMessages": "Unrecognized token 'filsdsrpinfed': When attempting to create issue

Patrick Jakubowski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 27, 2014

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.

1 answer

1 accepted

3 votes
Answer accepted
Patrick Jakubowski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 28, 2014

Figured it out, JSON whitespace was the culprit, was not properly removing it before sending.

Sorin Sbarnea
Contributor
January 21, 2015

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?

Rohanil Raje
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 3, 2017

I used json.dumps() on payload before passing it to request and it solved the issue

Tim van Ellemeet
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 29, 2018

json.dumps() for the win! 

Christian Bär
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.
June 16, 2021

Thank you guys!
Helped me with json.dumps() !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events