400 error when attempting create via rest message

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 vote

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.

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.

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?

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. 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

758 views 2 19
Join discussion

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