Is there a way to trigger an activity set based on a case form field in Kingston?

Pooja Reddy
Kilo Contributor

Hello,

I need to trigger an activity when a checkbox field on the parent case is checked (on the Kingston version). I am trying to use a script for the trigger condition but couldn't get it to work so far! If someone could help me figure out where I am going wrong, that would be brilliant!

Here's the script I'am using:

(function shouldActivitySetTrigger(parentCase /* GlideRecord for parent case */,
hrTriggerUtil /* hr_TriggerUtil script include instance */) {

if (current.u_checkbox_case_field == true) {
return true;
} else {
return false;
}
})(parentCase, hrTriggerUtil);

Many thanks in advance!

1 ACCEPTED SOLUTION

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

Try something like this in the Advanced Trigger. I am using a mycustom_field value from the parent (Lifecycle Event) case. Be aware that this trigger (Activity Set) will be evaluated on creation of the LE Case.

 

var gr = new GlideRecord('sn_hr_le_case');

if (gr.get(current.parent)) {

gr.u_mycustom_field = Yes; }

return true;

 

Regards,

Mike

View solution in original post

9 REPLIES 9

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

The activity set is not triggered as a result of the update of the parent. It just evaluates the Parent when the Lifecycle Engine reevaluates the trigger. 

 

Just to give an example, when you update a field value on the Parent case it does not instantly trigger the Activity Set, the LE Engine will re-evaluate on its schedule or conditions within the workflow (date, Previous activity set, etc.). 

 

If you can detail your use case I can give more detail as to how this works.

 

Mike

 

I have an onboarding form under talent acquisition and I have a field on the form that asks is this a transfer from another agency.  If yes then I need an activity set to be added along with the normal activity sets.  If no then just the normal activity sets prehire, preboarding day 1 etc. Below is a screenshot of my onboarding form and the transfer from the another agency is what I need to drive the activity set for transfers.  I hope that makes sense.

find_real_file.png

 

Hi Jen,

I have the same requirement , based on Country selected, like if USA, then  I want to trigger ABC activity set  and if other than USA , then its should take XYZ activity set and then normal activity sets work further. How can I acheive .

 

 

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@Jen  is this a variable, or are mapping that value to the LE Case?

Hi Michael, 

 

In my scenario. I am using advanced activity set trigger script for evalution which will be evaluated every 4 hours. But, i found today that the cases which were from dec 1 2020 are getting evaluated and others are not even getting glided. even though all the other cases are also in active state only. Could you help me here.