- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 03:31 PM
Hello, wondering if anyone can help me.
I've created a business rule to monitor our mid servers, so if a mid's status changes to "Down" this will trigger an incident. It's pretty simple but does the trick and is populating all the fields as desired... Bar one, I'm having issues with adding the mid server name to the cmdb_ci field (which does exist in the pick list). Any thoughts on
what I can do to remedy this?
(function executeRule(current, previous /*null when async*/) {
var inc = new GlideRecord('incident');
inc.cmdb_ci = current.name.getDisplayValue(); //<<--- This line here.
inc.category = "server";
inc.subcategory = "other";
inc.business_service = "9cac00421b38f4101666ecade54bcbd3";
inc.assignment_group = "36382a06db077f0010de6c16ca96191e";
inc.caller_id = "7c7c21791b07555045cf404cd34bcbc5";
inc.contact_type = "monitoring";
inc.short_description = "Mid server: "+ current.name + " is down";
inc.description = current.name + " is down, review information and work to resolve any issues." + " stopped: " + current.stopped + " Last refreshed: " + current.last_refreshed;
inc.insert();
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 03:36 PM
Have you tried using setDisplayValue
inc.setDisplayValue('cmdb_ci', current.name.getDisplayValue() );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2022 03:36 PM
Have you tried using setDisplayValue
inc.setDisplayValue('cmdb_ci', current.name.getDisplayValue() );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2022 01:55 PM
Worked a treat! Thank you!