Scheduled Job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 03:05 AM
Hello team how can i create a Scheduled job script on the table Incident with filter : active is true and approval is not requested and location is empty
to Set country to location.country
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 03:17 AM
Hi,
Schedule job is independent of any table.
You can execute the script of your choice within the schedule job.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 03:35 AM - edited 09-06-2023 03:35 AM
@Saurabh Gupta is my Scheduled Scrip correct ?
(function () {
var gr = new GlideRecord('incident');
gr.addQuery('approvam', '!=', 'requested');
gr.addQuery('location', '');
gr.query();
while (gr.next()) {
gr.location = location.country;
gr.update();
}
})();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 03:44 AM
Hi,
try the below script
var gr = new GlideRecord('incident');
gr.addEncodedQuery('active=true^approval!=requested^locationISEMPTY');
gr.query();
while (gr.next()) {
gr.location = location.country;
gr.update();
}
Thanks,
Vikas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 04:05 AM
@Community Alums i want
gr.region = location.country;
but i have an error : location not defined should i do
gr.region = gr.location.country;
?