- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2020 05:18 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 12:53 PM
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:
Case Task:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2020 01:30 PM
Hi! Thanks for the response.
Would this be a BR on the Case table?
Would I add the filter condition below? Also, would it be 'before' or 'after'? Also, would it be just 'Insert'?
Also, I want some of the fields on the Case Task to be configured with specific values. How would I configure the script for that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 07:17 AM
Additional Information:
This is what will be added to the Case, that I wish to to kick off the auto creation of a Case Task.
Task Category: Escalation
Priority: 2 - High
Reason for Escalation: Callback
Assignment Group: SMB Team
Assigned To: Empty/blank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 07:31 AM
Could you not do a current.work_notes.changes() in the BR?
Yes, I suggest an after-BR on the case table.
Regards,
Thom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 10:56 AM
Thanks Thom.
I'm not experienced with scripting. How would I configure the script, to auto create the Case Task, and include the default choices I need (highlighted above).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2020 11:39 AM
Hi,
You can do this through an "After" "Update" BR on your Case table with Conditions "Additional Comment changes"
Script would be something like-
var lastComments = current.comments.getJournalEntry(1);
if(lastComments.indexOf('The customer called and requested a callback') > -1){
var childTask = new GlideRecord('NameOfYourChildTaskTable');
childTask.initialize();
childTask.assignment_group = "ff0370019f22120047a2d126c42e702b"; //Add the sys_id of the assignment group
childTask.assigned_to = '6816f79cc0a8016401c5a33be04be441'; //Add the sys_id of the assigned to
childTask.priority = 2;
childTask.insert();
}
You can similarly assign values to the 'Reason for escalation' and 'Task Category' fields
