Send notification to only new group that added in list collector

lucky24
Tera Contributor

Hi Team,
I have created one custom field called "L1 Group" on the incident form and we have one notification "L1 group notification" that we want to send the group that is added in the field.
I want that when someone added new group in the L1 group field so only that group should be notified, it should not send the notification to exist group which is added before.
Can someone please help me here?

Regards & Thanks
Lucky

5 REPLIES 5

anshul_goyal
Kilo Sage

Hi @lucky24,

You can follow the below steps to trigger a notification to the 'L1 group':

1. Create a business rule and add a condition like 'L1 Group changes'.

2. In the Advance section, write the below script:

    var uniqueGroups = [];
    var previousGroup = previous.u_l1_group.split(',');
    var newGroup = current.u_l1_group.split(',');

    var arrayUtil = new global.ArrayUtil();
    uniqueGroups = arrayUtil.diff(newGroup, previousGroup);

    if (uniqueGroups) {
        gs.eventQueue('trigger_email_l1_group', current, uniqueGroups);
    }

3. Create an event and use it in the event Queue function.
4. Create a notification and use the event there to send to the group.

Please mark my solution as Helpful or Accepted if it works for you in any way!

Thanks