- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 11:25 PM
I created a Factor Type field in the Problem table.
Factor Type
Table : problem
Type : String
Column name : u_factor_type
Choice value
- internal_factor
- external_factor
- other
I want to see the fields below to auto-set the Factor Type field choices
Damage
Table : cmdb_ci_outage
Type : String
Column name : u_damage
Choice value
- having
- nothing
- other
Is there a way to get the information of the Incident record
from the related list of the Problem record and then the fields of the Outage record?
Thank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 11:48 PM
Hi,
This is how you can get the outage related with problem.
var incGr = new GlideRecord('incident');
incGr.addQuery('problem_id',current.getUniqueValue());
incGr.query();
while(incGr.next()){
var outageGr = new GlideRecord('cmdb_ci_outage');
outageGr.addQuery('task_number',incGr.getUniqueValue());
outageGr.query();
while(outageGr.next()){
gs.info('Damange :'+outageGr.u_damage);
}
}
Here current refers to the problem record.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 11:54 PM
Thank you for your reply.
One thing to check, is that script a Business Rule?
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 11:55 PM
You can use it in business rule running on problem table.
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 11:56 PM
If you want to run it in background script:
var incGr = new GlideRecord('incident');
incGr.addQuery('problem_id','sys_id of problem here'); // replace problem sys_id
incGr.query();
while(incGr.next()){
var outageGr = new GlideRecord('cmdb_ci_outage');
outageGr.addQuery('task_number',incGr.getUniqueValue());
outageGr.query();
while(outageGr.next()){
gs.info('Damange :'+outageGr.u_damage);
}
}
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2022 05:06 PM
Thank you for your reply.
I want to use client script.
But, I know that Using Glide Record in client scripts is deprecated as it degrades performance.
I think I'll be using Glide ajax and Script Include, but what about?
Thank you!