Set the opened for line manager to watchlist in HRSD

Supriya KM
Tera Contributor

Hello Everyone, 

 

I want to set the opened for line manager to the watchlist after the HR case is submitted but only for specific location of opened for.

Eg: If opened for location is Germany then only I need the line manager to be set in the watchlist..

Opened for is linked to HR profile

 

Can anyone help?

5 REPLIES 5

David Aldridge
Giga Guru

Hi @Supriya KM, there is an OOTB business rule called "Add HR supervisors to watch list" which is used to add specific group members to the watchlist of an HR case (for a VIP case). You can use this as a starting point and change the "When to run" rules to match your conditions and change the script to add the line manager.

Hello @David Aldridge 

Thanks for the reply. 

But my requirement is with the normal HR cases with the users not for VIP users. 
If any help on requested above is appreciated.

@Supriya KM I was just suggesting that you can use this Business Rule as an example to follow. Create your own business rule and set the "When to run" condition builder to your requirements. You'll also need to edit the script action, but you can re-use the elements that add users to the watch list.

Sandeep Rajput
Tera Patron
Tera Patron

@Supriya KM Please create a business rule as follows on sn_hr_core_case table.

 

Screenshot 2024-07-09 at 1.07.31 PM.png

Here I am assuming that location field on the user record has country field filled as Germany.

Screenshot 2024-07-09 at 1.08.24 PM.png

 

Here is the script

 

(function executeRule(current, previous /*null when async*/ ) {

    // Add your code here
    var watchlist = current.watch_list = '';
    if (watchlist) {
        current.watch_list = watchlist + ',' + current.opened_for;
    } else {
        current.watch_list = current.opened_for + '';
    }

})(current, previous);

 

Please mark the response helpful and correct if it manages to address your issue.