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

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

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?

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

json.dumps() for the win! 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

79 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you