178 views

Description

This happens when an hr task to submit a catalog item is assigned to an end-user. Once the user submits the hr catalog item/record producer, it creates a record with an hr service and attaches the template. The template attached to the record will not get any dependency values in the parent record. This happens because the parent record is not yet related to the created record upon insert. The business rule that applies the template runs after assignment rules, thus the assigned to needs to be a part of the group assigned to the case.

This issue occurs in: Instances in Madrid, New York, and Orlando

Steps to Reproduce

1. Create a Lifecycle Event with an activity (hr task template) assigned to the subject person to submit an HR Catalog item (hr task type: Catalog Item).

2. Create an HR Catalog item and an HR service associated to the catalog item. Include case option: "Skip Auto Assign" in the HR Service.

3. Create an HR Template for the HR catalog item, with "Assigned To" set to the parent case's "Assigned to"

4. Create a case for the Lifecycle Event and assign the case.

5. The Catalog Item HR Task should be created and assigned to the subject person.

6. Go to ESC portal and complete the task by submitting the HR catalog item.

7. Go to the case created by the catalog item and observe.

Expected behavior: The case is assigned to the user that is assigned to the parent LE Case.

Current Behavior: The case was auto-assigned to an assignment group, which the parent's assigned to may not be in, so the Assigned To field is blank.

Workaround

The change for this involves clearing the assignment group field so that the parent's assigned to can cascade to the child case via the Template. This is done during submission of the catalog item, but after the insertion of the case in the "post-processing" stage.


In Script Include "hr_TemplateUtils" (sys_id: d9f16db02f321200b3c9a310c18c959e):

Around line 107, change this code:

 apply: function(templateSysId, record) {

To this:

 apply: function(templateSysId, record, postCatalogProcess) {

AND around line 122, change this code:

if (assignedToValue)
    record.setValue('assigned_to', assignedToValue);

To this:

if (assignedToValue) {
     var group = record.getValue('assignment_group');
     if (postCatalogProcess && !gs.nil(group))
       record.setValue('assignment_group', '');
    record.setValue('assigned_to', assignedToValue);

in Script Include "hr_TaskTicket" (sys_id: aa749713539322003066a5f4a11c08de):

Around line 276, change this code:

  var gr = new GlideRecord('sn_hr_core_case');
  if (gr.get(scChildId)) {
   grChild = gr;
   gr.setValue("parent", taskGr.parent);
   gr.setValue("initiated_from", taskId);
   gr.update();

To this:

  var gr = new GlideRecord('sn_hr_core_case');
  if (gr.get(scChildId)) {
   grChild = gr;
   gr.setValue("parent", taskGr.parent);
   gr.setValue("initiated_from", taskId);
   gr.update();
   if (!gs.nil(gr.template))
    new sn_hr_core.hr_TemplateUtils().apply(gr.getValue('template'), gr, true);


Related Problem: PRB1399037

Seen In

New York Patch 4 Hot Fix 1b

Fixed In

Paris

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-06-18 10:50:20
Published:2020-06-18