
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2019 12:37 PM
I have a requirement to not close open problem tasks when a problem has the "Accept Risk" button clicked. This UI Action calls scripts using ProblemModalUIHelpers:
if (g_form && g_form.mandatoryCheck()) {
ScriptLoader.getScripts("ProblemModalUIHelpers.jsdbx", function() {
ProblemModalUIHelpers.onAcceptingRisk();
});
}
I tried to read the UI Script to see if problem tasks were closed from the onAcceptingRisk function, but it doesn't look like it. I am unable to find where this occurs. Once I get that figured out, I will be in a better position in deciding how to prevent them from getting closed. Any help would be much appreciated.
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2019 01:46 PM
Hi Trena,
In a baseline instance, I can see that the sys_properties table contains this property - try navigating to this link by replacing ***yourinstance*** with the url for your instance. Otherwise, navigate to the System Properties table by entering sys_properties.list into the Filter Navigator, and search for that property.
The business rule governing the function is found on the Problem table, and is named 'Cascade closure of Problem Tasks', which runs when State = Closed. It's functionality is outlined below:
Condition: gs.getProperty("problem.closed.cancel_open_tasks") == "true"
(function executeRule(current, previous /*null when async*/) {
var PRB_TASK_CLOSED_STATE = ProblemTaskState.States.CLOSED;
var problemTaskGr = new GlideRecord("problem_task");
problemTaskGr.addQuery("problem", current.getUniqueValue());
problemTaskGr.addActiveQuery();
problemTaskGr.setValue("state", PRB_TASK_CLOSED_STATE);
problemTaskGr.setValue("close_code", "canceled");
problemTaskGr.setValue("close_notes", gs.getMessage("Problem Task is Canceled based on closure of {0}.", current.getDisplayValue()));
problemTaskGr.updateMultiple();
})(current, previous);
Again, this is the baseline configuration but it is leveraging the system property I referred to, grabbing the state from the ProblemTaskState Script Include, and then iterating against all the records where the problem task is related to the problem.
The mitigation is simply toggling the property from true to false, which will mean the BR won't close the records.
Please let me know if you'd like further clarification.
Kind Regards,
Astrid Sapphire
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2019 01:54 PM
There is a BR "Cascade closure of Problem Tasks" on the problem that runs after the problem is closed.
It explains why the Problem tasks are getting closed.
Thank you.
Vinod Kumar Kachineni
Community Rising Star 2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2019 12:55 PM
Hi,
This is governed by a system property:
problem.closed.cancel_open_tasks
Perhaps in concert with another property where 'Accept Risk' moves the problem to closed.
See here for more detail: Problem Management Properties
Toggling this property would stop the action. While I haven't investigated the table in detail I would presume that Problem has a business rule to close child tasks if the above property is true. That will leverage a script include likely built by ServiceNow to handle that. Change and Incident tasks have similar functionality.
I would recommend modifying that property to meet your requirements.
Kind Regards,
Astrid

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2019 01:28 PM
Thanks Astrid. I have performed a global search for that property and I've search in the scripts of Script Include and UI Scripts with no reference to it. I would definitely like to find the flow that is causing the tasks to close when that property is true. Any ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2019 01:46 PM
Hi Trena,
In a baseline instance, I can see that the sys_properties table contains this property - try navigating to this link by replacing ***yourinstance*** with the url for your instance. Otherwise, navigate to the System Properties table by entering sys_properties.list into the Filter Navigator, and search for that property.
The business rule governing the function is found on the Problem table, and is named 'Cascade closure of Problem Tasks', which runs when State = Closed. It's functionality is outlined below:
Condition: gs.getProperty("problem.closed.cancel_open_tasks") == "true"
(function executeRule(current, previous /*null when async*/) {
var PRB_TASK_CLOSED_STATE = ProblemTaskState.States.CLOSED;
var problemTaskGr = new GlideRecord("problem_task");
problemTaskGr.addQuery("problem", current.getUniqueValue());
problemTaskGr.addActiveQuery();
problemTaskGr.setValue("state", PRB_TASK_CLOSED_STATE);
problemTaskGr.setValue("close_code", "canceled");
problemTaskGr.setValue("close_notes", gs.getMessage("Problem Task is Canceled based on closure of {0}.", current.getDisplayValue()));
problemTaskGr.updateMultiple();
})(current, previous);
Again, this is the baseline configuration but it is leveraging the system property I referred to, grabbing the state from the ProblemTaskState Script Include, and then iterating against all the records where the problem task is related to the problem.
The mitigation is simply toggling the property from true to false, which will mean the BR won't close the records.
Please let me know if you'd like further clarification.
Kind Regards,
Astrid Sapphire