- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 08:30 AM
I am having an issue assigning the value for the configuration item field in outages using a inbound action script.
// No Outage Found - Create Outage
var newOutage = new GlideRecord('cmdb_ci_outage');
newOutage.initalize();
newOutage.u_status = 'open';
newOutage.type = 'outage';
newOutage.u_cmdb_ci = 'TestApp';
newOutage.u_short_desc = email_subject;
newOutage.begin = gdt.getDisplayValueInternal();
newOutage.insert();
The CI is setup as a Business Service:
How would I assign this? The below code is not working:
newOutage.u_cmdb_ci = 'TestApp';
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 08:45 AM - edited 12-18-2024 08:53 AM
Hi @Randy33 ,
use below script
var newOutage = new GlideRecord('cmdb_ci_outage');
newOutage.initalize();
newOutage.u_status = 'open';
newOutage.type = 'outage';
newOutage.u_short_desc = email_subject;
newOutage.begin = gdt.getDisplayValueInternal();
var ci = new GlideRecord('cmdb_ci');
ci.addQuery('name', 'TestApp');
ci.query();
if(ci.next()){
newOutage.u_cmdb_ci = ci.getValue('sys_id');
newOutage.insert();
}
If my response helped, please mark it as the accepted solution ✅ and give a thumbs up👍.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 08:45 AM - edited 12-18-2024 08:53 AM
Hi @Randy33 ,
use below script
var newOutage = new GlideRecord('cmdb_ci_outage');
newOutage.initalize();
newOutage.u_status = 'open';
newOutage.type = 'outage';
newOutage.u_short_desc = email_subject;
newOutage.begin = gdt.getDisplayValueInternal();
var ci = new GlideRecord('cmdb_ci');
ci.addQuery('name', 'TestApp');
ci.query();
if(ci.next()){
newOutage.u_cmdb_ci = ci.getValue('sys_id');
newOutage.insert();
}
If my response helped, please mark it as the accepted solution ✅ and give a thumbs up👍.
Thanks,
Anand