- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 04:25 AM
How to configure a flag on problem list view to inform problem manager when all PTASKs are closed.
Could anyone suggest on how to proceed with this?
From what I understand, it should be like how when a incident is raised against a VIP user, in the list view you see a icon next to caller.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 04:27 AM
@Sandeep Rajput Thank you!
ServiceNow already has an OOB Business Rule "Check related Problem Task closure" which checks for all PTask closure for an problem.
I have added below(Your) code to set the flag value in OOB business rule:
var problem = glideProblemTask.problem.getRefRecord();
problem.<name of your flag>='true'; //replace with your flag name
problem.update(); //Update is taking place on the problem record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 03:52 AM
@Community Alums getRefRecord method returns a GlideRecord object for an element.
In my script we are querying for problem_task since problem is a field on problem_task, in order to make changes on the problem record, I had to use getRefRecord to fetch the corresponding GlideRecord of it. This is done to update value of the flag field which is present on the problem record.
Dot walking can be done to fetch the values from a reference field but in order to update the values use the following.
var problem = glideProblemTask.problem.getRefRecord();
problem.<name of your flag>='true';//replace with your flag name
problem.update(); //Update is taking place on the problem record.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 06:12 AM
@Sandeep Rajput Thank you for all your support on this, but facing an issue with updating flag value.
I can see that there's an OOB business rule for checking problem task closure and I have tried to add your above code to update the problem flag value, unfortunately not able to update it through Business Rule whereas I can update it through background script.
Any suggestion on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:32 AM
@Community Alums Could you please attach the snapshot of the Business rule (Entire form + Script) and the changes done by you. This will help me to find the root cause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 04:27 AM
@Sandeep Rajput Thank you!
ServiceNow already has an OOB Business Rule "Check related Problem Task closure" which checks for all PTask closure for an problem.
I have added below(Your) code to set the flag value in OOB business rule:
var problem = glideProblemTask.problem.getRefRecord();
problem.<name of your flag>='true'; //replace with your flag name
problem.update(); //Update is taking place on the problem record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 10:25 AM
@Community Alums There is a thumb rule to not to customise OOB business rules/script includes as they may be changed during upgrades and the changed record will get skipped from getting the latest changes.
I recommend you to revert you changes from the OOB business rule and create your own custom business rule to achieve this.
Since the script shared previously worked for you, you can mark that reply as a solution too.