Servicenow HRSD Lifecycle Event

TahiraS
Tera Expert

I want the activity set to get triggered based on the value of one of the fields on the parent case.  I tried the script but its not getting triggered:

I'm not sure how to utilize audience since we want to look at the previous step for the current lifecycle case.

This is the script I'm using, please help.  I did change the evaluation interval to 4 minutes for the activity set and even tried the 4 hours to check next day but its not getting triggered.

 

(function shouldActivitySetTrigger(parentCase /* GlideRecord for parent case */,
                              hrTriggerUtil /* hr_TriggerUtil script include instance */) {
        var gr = new GlideRecord('sn_hr_le_case');
        gr.addQuery('parent', parentCase.sys_id.toString());
        gr.addQuery('some_field''Fail');
        gr.query();
       
        if (gr.next())
            return true;  
        else
            return false;
})(parentCase, hrTriggerUtil);
1 ACCEPTED SOLUTION

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@TahiraS It is not recommended to reduce the Evaluation Interval value for this purpose. Starting in San Diego, we introduced an enhancement to trigger activity sets in more real time. Here is more information on that functionality which is the recommended approach for your use case.

 

If my answer has helped with your question, please mark my answer as an accepted solution and give a thumbs up.

Regards,

Mike

View solution in original post

5 REPLIES 5

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@TahiraS It is not recommended to reduce the Evaluation Interval value for this purpose. Starting in San Diego, we introduced an enhancement to trigger activity sets in more real time. Here is more information on that functionality which is the recommended approach for your use case.

 

If my answer has helped with your question, please mark my answer as an accepted solution and give a thumbs up.

Regards,

Mike

The condition trigger and business rule worked.  The only problem I faced was if the activity set of condition was not all the way at the end of the lifecycle, if it was in the middle then it didn't work, but at the end of the lifecycle worked according to the condition.

Sandeep Rajput
Tera Patron
Tera Patron

@TahiraS Did you try this script inside a background/fix script to see if it returns the correct result?

How can I check this in the background for a lifecycle case?

please refer to some article or tutorial.