File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Client-Side Components/Client Scripts/validate Interaction if it is an FCR(First Call Resolution) Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ // Business Rule: Set Resolution SLA on Related Tasks
2+ // Table: task_sla
3+ // When: After Insert
4+
5+ // PURPOSE:
6+ // When a new Task SLA is created for Resolution SLA, update the related records.
7+
8+ // CONDITIONS:
9+ // SLA Definition target = "Resolution"
10+ // Run only if task is Incident or SC Task
11+ // (current.task.sys_class_name == 'incident' || current.task.sys_class_name == 'sc_task')
12+
13+ // STEP 1:
14+ // Get the related Incident record from current.task reference
15+ var inc = new GlideRecord ( 'incident' ) ; // Query Incident table
16+ inc . get ( current . task ) ; // Fetch the matching incident record
17+
18+ // Update Incident’s custom field to store the Resolution SLA reference
19+ inc . u_resolution_sla = current . sys_id ; // Set current task_sla sys_id
20+ inc . update ( ) ; // Save changes to Incident
21+
22+ // STEP 2:
23+ // Get the related Task record from current.task reference
24+ var tsk = new GlideRecord ( 'task' ) ; // Query Task table
25+ tsk . get ( current . task ) ; // Fetch the task (incident/sc_task/etc.)
26+
27+ // Update Task’s custom field to store the Resolution SLA reference
28+ tsk . u_task_resolution_sla = current . sys_id ; // Set current task_sla sys_id
29+ tsk . update ( ) ; // Save changes to Task
You can’t perform that action at this time.
0 commit comments