Auto Close Lifecycle event case , once all child task gets close completed

ukti
Tera Contributor

Hi All,

 

I am trying to auto close lifecycle event case , when all the child tasks gets close completed . I have some activity sets which are triggering after 15 days . So Once all the tasks gets closed completed , I want to close the Parent case.

 

I have written BR on sn_hr_le_activity_set_context  - this table  and after update . and using below code. but its not working as expected , all the child tasks are going into error state.  Kindly help me on my below issue. 

 

if (current.workflow_context.id.hr_service.getDisplayValue() == 'Request Leave of Absence' && current.state == 'finished') {
      
        var gr = new GlideRecord('sn_hr_core_case');
        gr.addQuery('sys_id', current.workflow_context.id);
        gr.query();
        gs.info('Parul 30 ' + gr.getRowCount());
        if (gr.next()) {
            gr.state = 3;
            gr.update();
        }
    }

ukti_0-1704305655213.png

 

 

5 REPLIES 5

Hello Sara the Scheduled Job name is " Auto close case".