How to call Mid Server Script File from workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2022 09:31 PM
I have a Mid Server Script File, which I need to call in a workflow. How can I do that?
- Labels:
-
Orchestration (ITOM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2022 09:41 PM
Hi,
you create mid server script include and invoke it in this way
JAVASCRIPTPROBE AND MID SERVER SCRIPT INCLUDES
var jpr = new JavascriptProbe('<name of the mid server>');
jpr.setName("testcopypoc");
jpr.setJavascript("var req = new cpy(); req.prnt();"); //cpy1 is mid server script include name and prnt is the function in include
jpr.addParameter("<parameter>", ''); //if you want to pass parameter to mid server
jpr.addParameter("skip_sensor", true);
jpr.create();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2022 09:45 PM
And we can use this script to include in the run script, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2022 10:05 PM
Hi,
yes the above sample code I shared you can write that in workflow run script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2022 07:47 AM
So Is there any possible way that I could use my Mid Server Script File in the Mid Server Script Include?