Announcing the Global SNUG Board of Directors. Learn more here

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tiagomacul
Mega Sage
Mega Sage

 Scripts: Schedule a script execution using script (schedule jobs) 

 

Agendar um script para execução

.

var vId = current.sys_id;
var vNum = current.u_task.number;

var strScript = '';
strScript += 'var ObjT= new GlideRecord("task"); \n';
strScript += 'ObjT.addQuery("sys_id","' + vId + '"); \n';
strScript += 'ObjT.query(); \n';
strScript += 'ObjT.next(); \n';
strScript += 'ObjT.short_description = "ready"; \n';
strScript += 'ObjT.update(); \n';
strScript += '//Teste de script  /n';

var ObjTrigger = new GlideRecord("sys_trigger");   
ObjTrigger.initialize();
ObjTrigger.name  = 'Script update ' + vNum;
ObjTrigger.trigger_type= '0'; 
ObjTrigger.repeat = '00:10:00';
ObjTrigger.script = strScript;
ObjTrigger.next_action = current.sys_updated_on;
ObjTrigger.insert();




 

 

Know-More-Now-Logo.jpg

Script Summary

 

 

Scripts - Oficial Doc.

Schedule a script execution

Useful scheduling scripts

Scheduled Script Executions and Events Objectives

 

Was useful, please leave your feedback!

Comments
User674366
Tera Explorer

Thanks for sharing this.

Version history
Last update:
‎01-11-2019 07:51 AM
Updated by: