400 error when attempting create via rest message

Rob October 30, 2017

I've got ServiceNow sending Rest messages to a base Jira URL with several projects.  I've got roughly the same REST message working on 4 seperate projects, but the 5th one keeps sending me a generic 400 error.  

I'm reasonably certain I've ruled out formatting and authentication.
According to the Jira admin, I'm also sending all the mandatory fields and fair values for a couple checklists.  

Is there any way to coax Jira for more details on the 400 error?  
Is there any place in Jira that this error might be expressed more verbosely?
Are there other ways to make something "Mandatory" other than the database that would also apply to a rest message?

Thanks in advance for your help, community!

2 answers

0 votes
Rob November 1, 2017

On that note... is there any place in Jira that can log / analyze incoming rest messages and output/store the response messages?  Like if I just launch the rest message and have hte Jira admin simultaneously watching something that could expose the fault?

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 2, 2017

You could try to turn on access logging in Jira.   In the Jira administration page for this, there is a link to have Jira start logging all access requests.   On large environments with lots of users, this can create a lot of log entries very quickly.   It might not show you all the information you are looking for here, but it might be able to provide some more details about which user is requesting which resources. 

I still think that trying to make this call via a command line manually might be able to provide more details about why the request is being rejected. 

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2017

The HTTP 400 error just means "bad request".  It can be difficult to understand why it's a bad request in some situations like this, because Jira might actually be telling you more about this, but it might not be visible to the other program like ServiceNow.

There are a number of other users that have reported this error and ultimately found a number of different causes for this error.  A few examples:

One way I would be interested to try to troubleshoot this would be to try to recreate the REST call yourself via a command line using a utility like curl.   REST API calls made with curl are most easily done with basic authentication (username and password), but I think it's worth testing this in this method, because I think there is a possibility that Jira will provide more information if you still get a 400 error as to why Jira believes this request is invalid.  It could be you are tried to update a field that isn't in the screen, or something like a malformed json request.

Since you can do this for other projects, it might also be beneficial to try to understand how this project is different from those other projects.  Is this a Service Desk, Software, or Business project in Jira?  Is this Jira Server or Jira Cloud?  If Server, what version of Jira server?  

Would it be possible to share more details of the REST call being made that is getting rejected?   Just curious if we can dig into the details more to better understand what might cause this problem here.

Rob November 1, 2017

Hey Andrew,
Thanks so much for taking the time on this one.  I'll take a look about just pasting the JSON here... but I don't think its malformed since the same payload will work on different projects.

As for project differences, I'm basically here because I *THINK* I've factored for all of them.  I started with just form fields that were mandatory... all the way up to sending something/anything to each of the visible fields.  I've even factored for assignment rules that are enforced client side.  

I'll defo try the curl method.  I was assuming that ServiceNow was showing me the full response payload, but maybe not.

Suggest an answer

Log in or Sign up to answer