HRSD

abhisek
Tera Contributor

This HR case has been assigned back to the group as the previous 'Assigned to' user ${assigned_to} is now inactive or no longer a member of ${assignment_group} group.

 

I have written the above line in the notification body. It is populating the assignment group name but not the previous assigned to. I need to populate the previous assigned to as well. 

 

Can anyone please help me out.

4 REPLIES 4

Robbie
Kilo Patron
Kilo Patron

Hi @abhisek ,

 

The 'previous' keyword is not available within email notifications. You're probably used to seeing this handle in business rules along with 'current'.

 

How are you triggering the email? Is it conditionally based (using the config builder) or are you triggering via an event.

If via an event, you can pass the previous value in as a parameter - see the below example:

 

gs.eventQueue("event_name", current, previous.assigned_to.getDisplayValue(), parm2);

 

This can then be called from the notification script as follows:

 

<mail_script>

template.print("Previous Assigned To: "+ current.parm1);

</mail_script>

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

Hi @Robbie 

Thanks for your reply. I am triggering the notification through event and script include.

Hi @abhisek ,

 

Thanks for confirming. As mented in my initial response, when you trigger the event pass the previous assign_to value as a parameter in the gs.eventQueue() method as show below:

 

gs.eventQueue("your_event_name", current, previous.assigned_to.getDisplayValue(), parameter_2_or_poass_empty_string);

 

This can then be called from the notification script as follows:

 

<mail_script>

template.print("Previous Assigned To: "+ current.parm1);

</mail_script>

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

gs.eventQueue('event name', tableGR, recipientList.join(','), 'HR Case is unassigned');
 
Above is the code written in script include by which I am triggering the notification and this code I can't change as per my other requirement.
So, could you please suggest what should I do now?