Create ServiceNow Ticket in Workflow

Does anyone have a functional demo creating a ServiceNow ticket in workflow? My prototyping is failing with essentially no debug info except for:

“error parsing the response body: invalid character ‘<’ looking for beginning of value”

I’m sure my configuration is lacking but documentation on this action is pretty limited. Hopefully the workflow team has future plans to leverage peoples existing investment in the ServiceDesk Ticketing integration.

Hi Jason,

I don’t think there’s anything you can do to resolve this. The workflow engine is having trouble parsing the response because it contains a character it didn’t expect. If you haven’t already, please open a support ticket and provide your workflow script so they can identify what is going on.

Hi Jason, I have seen this same error in a Workflow I am building. Were you able to figure out the issue and fix for this?

I was seeing this same problem and to be honest the documentation on the Manage ServiceNow Ticket node could use some attention. Some things I have discovered:

  • Manage ServiceNow Ticket is calling …/api/now/v1/table/incident behind the scenes. If that doesn’t match your requirements you’ll need to switch to using HTTP Request node(s)
  • If you switch to using HTTP Request node, be aware that the authentication provided by the HTTP Request node does not support a grant_type of ‘password’, which is required by the ServiceNow API. You will need to manually create 1 HTTP Request that authenticates to ServiceNow and then use the token from that request in a second HTTP Request that opens the ticket.
2 Likes

Having the same error, i’m unable to discern what the issue is as the json appears to be valid in my test cases. Was there ever any success in getting the Manage Ticket action to work?

Please check with your Service Now team whether they are blocking/white listing any IPs from creating tickets. In our case it worked once the IP was allowed access.

Sharvari, can you please share how you were able to obtain the IP address for your IDN tenant?

We got it from the logs enabled on Service Now side when ticket request was being sent. But the problem is the IP keeps changing.

Helpful read- The range of IP addresses that the IDNow Saas Connector uses - #6 by colin_mckibben

Thanks for sharing Sharvari.

I’ve created an idea to have fixed tenant IP address ranges as an option, would be great to get some more votes for it to hopefully have it picked up:

https://ideas.sailpoint.com/ideas/GOV-I-2490

Hey @colin_mckibben @brad_grutsch
How to utilise HTTP action in workflow as two step process to achieve grant_type 'password' ?
Could you please help me with that? Should it be a custom authN and what will be the header key and value? All I have is client_id, username and password.
Thanks!

I left Authentication Type blank and sent a POST to …/oauth_token.do with Request Content Type Form and Request Body that had these key-values:

  • client_id: ***********
  • client_secret: ***********
  • grant_type: password
  • password: **************
  • username: [service account username]

Then, in the second HTTP Request I’m using this in the Request Header to get the token from the first one:

  • Authorization: Bearer {{$.hTTPRequest.body.access_token}}
1 Like

It doesn’t appear that our instance has any block or ip whitelisting rules for this - still getting the same error of “error parsing the response body: invalid character ‘<’ looking for beginning of value”

where would I find logs of this in servicenow to validate the attempted connection? i’m not seeing anything obvious and I’ve yet to successfully use this action, HTTP requests work fine, albeit a little extra work to setup.

You can ask Service Now team to check logs on their end for the request received and response being sent, that usually helps. Also, turn on ccg logging in IDN to see additional details for this request.

Not sure if it will help you now but I got the same error this afternoon. I resolved it by providing the appropriate endpoint.

I am not much of a ServiceNow developer so I am not sure if these are custom, but was:
Incident: https://tenant.service-now.com/api/now/table/incident
Task: https://tenant.service-now.com/api/now/table/sc_task

1 Like

One note @Tellius is that the table name for the task table is just task, and sc_task is the Catalog Task table. Catalog tasks are typically child objects of Requested Items (sc_req_item), which are typically child objects of Requests (sc_request).

In my experience, it’s best practice not to create a service catalog task directly through the table API, but to submit a request for a catalog item using the Service Catalog API. The order now method is something we use.

The requested item workflow in ServiceNow will then typically create the Service Catalog task

Thanks @mcheek. I will definitely give that a go. My plan was to talk to my local experienced ServiceNow dev on the team when he was back on deck. Thanks for the assist!

Just a quick query @mcheek - have you got the Service Catalog Order now method working with the “Manage ServiceNow Ticket” action in Workflows or did you do it all via the HTTP action? I would love to see some of the configuration you did to get it working if you were up to sharing.

We aren’t actually entitled to the workflows feature, so I don’t have an example where we use this, so I’m not sure what attribute the “manage ticket” action is looking for in the payload

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.