- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 07:38 AM
Hi All,
I am creating a script to extract some specific value followed after a keyword.
answer = (function transformEntry(source) {
var GR = source.u_description.toString();
var index = GR.indexOf("Fault Offset:");
var offset = GR.substring(index, index + 9);
return "source.u_short_description + '' + offset";
})(source);
Intension is to get the value after 'fault offset:' from source description is set to a custom field.
I see no result using this script. Please advise on this.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 07:51 AM
Which type of transform script are you writing?
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 07:59 AM
Try changing
return "source.u_short_description + '' + offset";
to
return source.u_short_description + ' ' + offset;
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 07:51 AM
Which type of transform script are you writing?
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 07:57 AM
Hi Anubhav, I should have mentioned, This is field map script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 07:59 AM
Try changing
return "source.u_short_description + '' + offset";
to
return source.u_short_description + ' ' + offset;
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 08:03 AM
Sure Slava, I'll try that