Hi everyone,
I've been tasked with building an integration between ServiceNow and JIRA. I'm getting the following issue when sending a POST to JIRA from ServiceNow.
From my understanding this seems to be an issue with the JSON but I can send exactly the same JSON to JIRA from Postman and it works perfectly. Any and all help will be appreciated.
Here's a link with the same question posted onto the ServiceNow Community site. It has a bit more information including scripts and JSON.
Thanks for the help,
Mike.
REST Endpoint
https://[company].atlassian.net/rest/api/latest/issue
JSON -This same JSON was sent to the endpoint above using postman and worked perfectly. I also aimed my script at the postman mock server and that also returned a response.
{
"fields":{
"customfield_10031":"[company].service-now:8d2c88e3db1df78060319ee3db9619c0",
"customfield_10033":"INC0001032",
"description":"Description 2",
"issuetype":{
"name":"Bug"
},
"priority":{
"id":"4"
},
"project":{
"key":"STES"
},
"summary":"Short description"
}
}
I had this same error message. My issue ws that I was passing the fields object as a query parameter. When I moved it to the body, it worked.
Here's an example of my fields object. It works under version 2.
{
"fields": {
"summary": "Main order flow broken",
"customfield_xxxxx": "xxxxxxxxx",
"issuetype": {
"id": "xxx"
},
"project": {
"key": "xxx"
},
"description": "Order entry fails when selecting supplier.",
"reporter": {
"id": "xxxxxxxxx"
},
"labels": [
"bugfix",
"blitz_test"
]
}
}
Hello,
I believe the problem is with the payload (json). You should add your json to the question and the rest endpoint you call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks I've added the requested items.
I just wanted to add that I'm running this from a UI action in SNOW which fires off a POST REST to the endpoint. When amending this endpoint to a Postman Mock server it works fine, but as soon as I change it back to the Endpoint above that's when I get the error.
I can also fire off a test POST from outside the script with the exact JSON above and to the final endpoint and it works fine. It seems to be something to do with the script creating the REST call. I've added the community post I have on the ServiceNow website and that has all the scripts in there.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Michael_Hall Did you find the solution for this? Can anyone please help me with the solution. I am facing same issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had this error when trying to access the baseURL using HTTP instead of HTTPS. Due to the HSTS configuration, using HTTP will return status code 301 with header Location: https://<restofthebaseurl>.
Depending on the client, it will not repost the body to the new URL. In curl you'd have to add --post301 for this to happen, the JIRA Java REST client SDK also breaks, and Postman might do this by default.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Lewis Martins - your comment helped me out here! Thanks for the post and other comments here too ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still encountering the same issue myself. Clients like Postman or even iOS Shortcuts seem to have no issue uploading a payload to the request, but any RESTful attempts I've given have yielded the same error message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Georgeta Pojoga@Mitchell Budge did you figure this out? I am having the same problem. It works from Postman (returned 204 and fields are changed). When I try from python I get a 400 'No content to map to Object due to end of input' error.
I can take the payload from my script and drop into postman without any issues. My python get requests have no issues. Haven't tried other puts yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For me in the end it was an axios problem, didn't read the documentation and I passed the wrong input. I don't know if this can help :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured it out. I was sending the json body as request.payload instead of request.data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you hit api from postman it works because postman add some header automatically like "Content-length" and "host", so if you add those in your python code, it will work.
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.