Autopopulate Configuration Item from short description
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 07:48 AM
Hi all,
I'm trying to change an existing business rule to populate Configuration Item that match the one from short_description in the incident table, then it should change the location based on CI location.
(function executeRule(current, previous /*null when async*/) {
if(!current.cmdb_ci) {
var grLocation = new GlideRecord('cmdb_ci_server');
grLocation.get(gs.getProperty('cmdb.ci'));
current.setValue('cmdb_ci', gs.getProperty('cmdb.ci'));
current.setValue('location', grLocation.getValue('location'));
}
Anyone have a suggestion here?
Much appreciated
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 08:15 AM
Hello,
Change the script to before insert/update.
and i hope the property name is correct and correct values ahs been stored:-
gs.getProperty('cmdb.ci')
Please mark my answer as correct based on Impact.