Where to find closeRelatedTasks(current);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2017 04:38 PM
Hello All,
I am trying to find the body of the function closeRelatedTasks(current); in the below business rule
Name: SNC - ITIL - Resolve Related Incidents (Global)
Script:
if (current.problem_state.changesTo(4))
{
resolveRelatedIncidents(current);
closeRelatedTasks(current);
}
//
// Resolve any incidents that are related to the current problem
//
function resolveRelatedIncidents(me)
{
var incident = new GlideRecord("incident");
incident.addQuery("problem_id", "=", me.sys_id);
incident.query();
while (incident.next()) {
if ( incident.active == true )
{
............................................
...........................................
............................
incident.state.setValue(6);
incident.comments = msg;
incident.update();
}
}
}
The business rule gets executed without any errors when a new problem is inserted or updated in the Problems table. When the function is not defined in the first place, I am wondering from where is the function closeRelatedTasks(current); is getting executed when its not defined in the first place. Any help is greatly appreciated.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2017 04:51 PM
Hi Aman,
By default this BR is set to active false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2017 04:59 PM
But I need the function Body of CloseRelatedTask();
I wonder where it's hiding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2017 01:44 PM
After digging some concepts of Global business rules, found that
The body of the function CloseRelatedTask(current);
is located in SNC - ITIL - Close Related Global Business rule which is defined on Global Table
->Global business rules are business rules where the Table field is set to Global. Global business rules may be accessible on multiple tables and from other scripts, depending on their scope protection.
->Using global business rules allows the creation of functions that can be used anywhere in the system.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 12:24 PM
I had no idea you could do that. Huh. Thanks for this info!