HRSD Activity Sets: How to Check Multiple Prerequisite Sets with OR Logic
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I'm working with ServiceNow HRSD and need to create an advanced trigger condition for an activity set that should trigger when either of two prerequisite activity sets has completed, rather than requiring both to be finished.
Current Setup
- Module: ServiceNow HRSD
- Context: Lifecycle Event activity sets for parental leave cases
- Table: sn_hr_core_case_total_rewards
- Requirement: Trigger when prerequisite Activity Set A OR Activity Set B is completed
The Challenge
The standard hrTriggerUtil.checkActivitySetsCompleted() method seems to require ALL activity sets in the provided array to be completed. However, I need OR logic where completion of either activity set should allow the trigger to proceed.
Current Approach
I've implemented this solution in my trigger condition script:
(function shouldActivitySetTrigger(parentCase, hrTriggerUtil) { // Separate checks for each prerequisite activity set var SET_A = 'activity_set_sys_id_1'; var SET_B = 'activity_set_sys_id_2'; var setACompleted = hrTriggerUtil.checkActivitySetsCompleted([SET_A]); var setBCompleted = hrTriggerUtil.checkActivitySetsCompleted([SET_B]); // Other business logic validation... // Return true if EITHER set is completed return setACompleted || setBCompleted; })(parentCase, hrTriggerUtil);
Is this the correct approach for implementing OR logic with prerequisite activity sets in HRSD?
It is not triggering as I want it to 😞
Any ideas? Thank you.
0 REPLIES 0