Conditional Scheduled imports

Ganesh291
Tera Contributor

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;

}

find_real_file.png

Regards,

Ganesh.

7 REPLIES 7

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.


Chuck Tomasi
Tera Patron

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?


Yes Chunk.