
- 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-17-2020 11:24 AM
No problem 😃 I'm just a gamer geek getting into everything which got levels, points, and achievements 😃
Just let me know if you run into anything else.
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor’s Guide To ServiceNow