The CreatorCon Call for Content is officially open! Get started here.

Possible to create Scheduled Task?

ryan86
Kilo Expert

We have a requirement for a TASK to be created, yet not appear in the Service Desk queue until a certain date.

 

Or, the ability to create a TASK, and then place it "on hold" or make it "hidden" until a certain date. (IE. If a laptop was loaned to a department, we may wish for a task to be allocated to the Service Desk team in 6months time, asking them to locate and collect it).

 

It doesn't appear that this is possible OOB, but it seems a fairly simple and useful function?

 

All help appreciated!

1 ACCEPTED SOLUTION

It may be better to not have the task be created at all until it's needed. I'd have a scheduled job create the task when it's needed instead of having to figure out a way to keep it in a hidden state (which means changing module links so others can't see these tasks and possibly changing email notification conditions to not fire off when these tasks are created- and SLAs if there are SLAs at the task level).



A simple script that runs and creates a catalog task (to be used as a scheduled job):



var createTsk = new GlideRecord('sc_task');


createTsk.initialize();


createTsk.short_description = 'Short Description here';


createTsk.description = 'Description here';


createTsk.assignment_group = 'assignment group sys_id here';


createTsk.state = 'state value here';


createTsk.insert();


View solution in original post

3 REPLIES 3

amacqueen
Mega Guru

Would a scheduled job not do it simply?



The below appears when you choose new for a scheduled job:-



find_real_file.png


Subhajit1
Giga Guru

You can make a Custom State called Hidden and set the Status field of these tasks to Hidden upon Creation.


Now you can run a scheduled script everyday to check for Tasks in the Hidden state and Created More than 6 months Ago and then set the status of these tasks to state Assigned.



You will need to add a Filter on the Service Desk queue to Remove tickets in the State Hidden.



Hope this helps.



Thanks,


Subhajit


It may be better to not have the task be created at all until it's needed. I'd have a scheduled job create the task when it's needed instead of having to figure out a way to keep it in a hidden state (which means changing module links so others can't see these tasks and possibly changing email notification conditions to not fire off when these tasks are created- and SLAs if there are SLAs at the task level).



A simple script that runs and creates a catalog task (to be used as a scheduled job):



var createTsk = new GlideRecord('sc_task');


createTsk.initialize();


createTsk.short_description = 'Short Description here';


createTsk.description = 'Description here';


createTsk.assignment_group = 'assignment group sys_id here';


createTsk.state = 'state value here';


createTsk.insert();