- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2016 11:28 AM
i need a simple integration to return fields with certain parameters on utilizing of Post. I basically need to rename some of the fields on the response body. Does ServiceNow have the ability to retrieve the results of a Post, utilize server side code and generate a new return body, or will I need to create a web service in order to handle the out-of-box return messages? I am doing a custom integration for Slack if that matters.
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2016 11:58 AM
Scripted REST was introduced with the Geneva release, so this won't be an option for you then. Any chance you have a G upgrade on the horizon?
If not, this can also be accomplished with a custom Processor, but beware these are a bit trickier to work with. Here's a bare-bones tutorial to get you started:
http://wiki.servicenow.com/index.php?title=Tutorial_4_Creating_a_Custom_Processor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2016 12:52 PM
@NeriusNow can the processor read Post properties or only query string?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2016 01:25 PM
I've written a blog series on custom building a REST API (only using GET), partly to be able to rename fields. Part 6 is on building a processor. And, yes, processors can do POST:
GQL (Glide Query Language) Part 6: The Processor
Part 4 describes the Script Include that fetches the data; if you want to keep it simple, this may be included in your processor:
GQL (Glide Query Language) Part 4: The Retriever
Good luck!
Please feel free to connect, follow, mark helpful / answer, like, endorse.
John Chun, PhD PMP ![]() | ![]() |
Winner of November 2016 Members' Choice Award
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2016 01:29 PM
Also, if you're using JSON, you might want to make a note of the below:
g_processor.writeOutput("application/json", new global.JSON().encode(result)); // works in global & scoped
g_processor.writeJSON(result); // works in scoped only