Scheduled job condition check
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 04:55 AM - edited 11-14-2022 04:58 AM
Hi All
Whenever a new entry is created in u_custom_integration table with trigger status as "pending" I need to run a specific script through the OnDemand scheduled job. for achieving this I tried the below condition in the scheduled job but it's not considering the real-time entry details if there are multiple entries with trigger status as "pending"
How to solve this issue?
so as soon as a new entry is created in u_custom_integration table with trigger status as "pending" I need to run a custom script
retrigger1();
function retrigger1() {
var answer = false;
var grcsi = new GlideRecord('u_custom_integration');
grcsi.addQuery('u_trigger_status', 'Pending');
grcsi.query();
var value = grcsi.getValue('sys_id');
gs.log("valueis "+ value);
if (grcsi.next()) {
var triggerstatus = grcsi.getValue('u_trigger_status');
if (triggerstatus =="failed"){
answer =true;
}
}
answer;
}
u_custom_integration table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 05:21 AM
Why not try after insert business rule with condition trigger status as Pending?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 05:34 AM
Br already written this for retriggering mechanism
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 05:32 AM
Hi @jobin1 ,
You can writedown Br after Insert
Condition trigger status is pending
Script :-
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
SncTriggerSynchronizer.executeNow(rec);