Auto Create Case Task from Case field value

MStritt
Tera Guru

Hello,

I would like to auto create a case task with certain field values (and it be auto saved), when a specific field is populated on the case. The field on the case (checkbox) will be auto checked when a specific update is automatically added to the activity stream of the case.

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Add this code and check-

var lastComments = current.comments.getJournalEntry(1);
if(lastComments.indexOf('The customer called and requested a callback') > -1){
var childTask = new GlideRecord('sn_customerservice_task');
childTask.initialize();
childTask.assignment_group = "ff0370019f22120047a2d126c42e702b"; // replace the sys_id with sys_id of the group
childTask.parent = current.sys_id;
childTask.short_description = "Child Task Test";
childTask.insert();
}

 

I tried this on my PDI and it works:

 

Case:

find_real_file.png

 

Case Task:

 

find_real_file.png

View solution in original post

18 REPLIES 18

Thanks! When you say Child Task Table, do you mean the Case Task table?

Community Alums
Not applicable

Yes, the Case Task table

Thanks! One more question before I create the BR. If I want the 'Assigned To' field to be blank/empty, do I need to configure that? Or just not include it in the script?

Community Alums
Not applicable

Do not include that field in the BR 🙂

OK. This is how I've configured the BR. When 'The customer called and requested a callback.' was added to the case, a Case Task wasn't created. 

find_real_file.png

find_real_file.png