Send email to Watchlist Users,and Users who Follow the Case after An Inbound Email.

Sndeveloper Adm
Tera Guru

Hi, 

 

I have the below requirement in Service Now CSM.

 

Background : we have Inbound email action , where the emails are received have Record Type configuration.

 

Requirement : When the above email( Inbound ) received to Service now , we need to send an email ( outbound) to - the users who are in 1- Watch list 2.Who follow the case ( follow button )  that --- the case XXXX  is updated with an Email which is received from user (xyz).

 

 

Current Configuration Details. 

 have below configuration for Inbound Email.

SndeveloperAdm_0-1727278354070.png

 

Actions Code : 

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {

   

    var worknoteArray = '';

    var senderName = gs.getProperty('gcs.casemgmt.email.sendFrom', 'XXXXX');

    var instanceInfo = gs.getProperty('instance_name', 'XXXXX');

    var lines = email.body_text.split('\n');

    for(var i in lines){

       

        if(lines[i].indexOf(senderName+' <'+instanceInfo+'@service-now.com>') > -1){

            break;

        }

        worknoteArray += lines[i]+'\n';

    }

    current.work_notes = worknoteArray;

    current.update();

 

 

    })(current, event, email, logger, classifier);

 

This script processes incoming emails, extracts the body of the email up until it finds the sender's signature, and adds that content to the work_notes field of the current record  It ensures that unnecessary parts of the email (like signatures or footer information) are not included in the work notes.

 

 

So my requirement is when the above email is received to Service Now , it should trigger another email to Watchlist users --that an email is received on the CASE XXXX

 

Can you please provide step by step how to achieve this ?

 

I have seen in some community posts to write business rules on *live_group_member* table for Sending notification of Follow button.. Can any one confirm on this ? 

 

 

 

Best regards,

Adnav

 

 

2 REPLIES 2

Brad59
Giga Guru

What I would do is queue an event in your inbound action that is then the trigger for the outbound email. You may configure an email to send on event creation. You should be able to provide details and recipients as event parameters.

 

More info on events: Solved: gs.eventqueue - ServiceNow Community

Community Alums
Not applicable

Hi @Sndeveloper Adm 

Below are few steps , which can be helpful.

Regarding Follow , you can configure a flow(trigger created /updatedfor live_group_member) inorder to set the notification field to true, as soon as someone follows the case ,as it will insert a record into live_group_member table . We can give an if condition in the trigger , that if the state is active, make the notification field set to true.Else condition if  someone unfollows( means state is inactive), it we can set the notification to false.

 

For sending notification to watchlist and the followers , create another flow as trigger for Inbound email . We can create a lookup of the related  record , and give some conditions . We can also create lookup records for live_group_member table and check the below condition : group.document IS lookup record is Target Table Record of the email and another condition as notification is true. 

We can use send email action to use the watchlist and get the members from the above lookup actions to send an email.

 

Please check if this is helpful.