Conditional Scheduled imports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2017 05:25 AM
Hello,,
I'm working on Scheduled imports and I want to execute the scheduled import based on condition, can some one share the sample script to evaluate true or false(below image), I want to write a
Script like below (Example condition like for all P1 incidents this scheduled import will be execute), Can I do like this? please share your ideas.
var gr = new GlideRecord('incident');
gr.addQuery('priority',1);
gr.query();
while(gr.next()){
answer = true;
}
Regards,
Ganesh.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2017 05:55 AM
I didn't see anything to lead me in that direction of setting answer... All the docs say is:
The last expression of the script should evaluate to a Boolean (true/false) value.
My script only has one statement, the IEFF function.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2017 05:37 AM
Hi Ganesh,
The condition field simply says "I want this scheduled job (import) to run when the condition is true." Are you just looking to skip the job when there are no P1 issues?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2017 05:40 AM
Yes Chunk.