call script include

shabbir9
Tera Contributor

Hi Team,

 

can anyone help me in the script how to call script include and its function from schedule job for every 24 hours i have to call the script include from schedule job

1 ACCEPTED SOLUTION

Arun_Manoj
Mega Sage

Hi @shabbir9 

 

 

If Scheduled job and script include is in the same scope, then

var obj = new SCRIPT_INCLUDE_NAME().FUNCTION_NAME();

For calling the global Script include from scoped app

var obj = new global.SCRIPT_INCLUDE_NAME().FUNCTION_NAME();

Please refer Use script includes | Servicenow Docs

Hope that helps!

Regards,

Arun

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@shabbir9 

the scheduled job can be configured to run daily

Syntax is same as that of any server side script

new ScriptIncludeName().functionName()

what did you try and what didn't work?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@shabbir9 

Would you mind closing your earlier questions by marking appropriate response as correct?

Members have invested their time and efforts in helping you.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Arun_Manoj
Mega Sage

Hi @shabbir9 

 

 

If Scheduled job and script include is in the same scope, then

var obj = new SCRIPT_INCLUDE_NAME().FUNCTION_NAME();

For calling the global Script include from scoped app

var obj = new global.SCRIPT_INCLUDE_NAME().FUNCTION_NAME();

Please refer Use script includes | Servicenow Docs

Hope that helps!

Regards,

Arun