- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 03:42 AM
If the Assigned to is Inactive, then make the assigned to as blank.
Need this for all the Open Active tickets including Incidents, tasks, Problem, RITM's
Can you please help me achieve this. Do we have to create a Flow or it can be done using BR.
Please provide the Flow or the script for this.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 03:56 AM
@atul_05 Then you can create this as a scheduled job and run on a daily basis. This way the ticket will get updated on a daily basis.
Here is the filter I created for the script on the task table.
Here is the script I wrote to fix the records.
var glideTask = new GlideRecord('task');
glideTask.addEncodedQuery('active=true^sys_class_name=problem^ORsys_class_name=incident^ORsys_class_name=sc_task^ORsys_class_name=sc_req_item^assigned_to.active=false');
glideTask.query();
while(glideTask.next()){
glideTask.setValue('assigned_to','');
glideTask.update();
}
You can put this script inside a fix script or a scheduled job.
Please make sure to test this script on a non prod instance first, verify the result and then run it on a prod instance.
Please mark the response helpful and accepted solution if it managed to address your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 03:44 AM
@atul_05 You can achieve this via a Fix script/Background script. Let me know if you need any help in creating the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 03:46 AM
I want this to run every time and check for any Open tickets in the future as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 03:56 AM
@atul_05 Then you can create this as a scheduled job and run on a daily basis. This way the ticket will get updated on a daily basis.
Here is the filter I created for the script on the task table.
Here is the script I wrote to fix the records.
var glideTask = new GlideRecord('task');
glideTask.addEncodedQuery('active=true^sys_class_name=problem^ORsys_class_name=incident^ORsys_class_name=sc_task^ORsys_class_name=sc_req_item^assigned_to.active=false');
glideTask.query();
while(glideTask.next()){
glideTask.setValue('assigned_to','');
glideTask.update();
}
You can put this script inside a fix script or a scheduled job.
Please make sure to test this script on a non prod instance first, verify the result and then run it on a prod instance.
Please mark the response helpful and accepted solution if it managed to address your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 04:58 AM
Hello @Sandeep Rajput
Can you please elaborate more on how to create the scheduled job. I have created the filters that you have shown but under scheduled jobs, it asks for what would you like to automate?
Which one we have to select from below?
- Automate the generation and distribution of a report
- Automatically generate something (a change, an incident, a ci, etc) from a template
- Automatically run a script of your choosing
- Automatically run a script to create a report summary table
- Automate the generation and distribution of a custom chart
Also, will this run automatically or we have to run this manually every day.