
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 10:41 AM
Hi,
I'm trying to create a before business rule that changes the short description of an incident to something from the description of the incident. I'm trying to parse the description (never done this before!).
Basically - I want to take all the text after Alert Description: in the description and populate the short description with it. I have this script;
current.short_description = u_description_html.indexOf("Alert Description:==14")
Will this work? Be kind - I've new to coding!!
Thank you
Rich
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 11:00 AM
Hi Richard,
If you only need to 15 first, you can use substring function to pull that out.
var descSplit = current.description.split('Alert Description:');
current.short_description = descSplit[1].substring(0,14);
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor’s Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 11:15 AM
if you want to do it code-wise, this would do it:
Feel free to connect:
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor’s Guide To ServiceNow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 04:41 AM
Thank you - that works perfectly.
Final question is it possible to limit the characters that I'm bring over from the description...? I probably only need to use the first 15 characters.
Thanks for your help
Rich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2020 11:00 AM
Hi Richard,
If you only need to 15 first, you can use substring function to pull that out.
var descSplit = current.description.split('Alert Description:');
current.short_description = descSplit[1].substring(0,14);
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor’s Guide To ServiceNow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2020 01:16 PM