The CreatorCon Call for Content is officially open! Get started here.

Business rule after inbound email action

Sndeveloper Adm
Tera Guru

Hi Experts, 

Looking for some suggestions on the below requirement.

Case :

I have a inbound email action which is updating the Incidents . 

Requirement is : 

When an email arrives into the record , It should notify the watch list users -- For example with Subject :*That a new email has arrived for the incident you are watching *

 

Basically --all watch list users should be informed about incoming email . 

 

How to implement this ? I need a solution design for this requirement as soon as possible. Please pour in you solutions..

 

thanks in advance,

Tia.

7 REPLIES 7

@Anantha Gowrara 


this is the My inbound email action . Can  you tell me , what should i add ?

 

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

    //gs.info('xxxx: '+email.body_text.split('\n'));
    var worknoteArray = '';
    var senderName = gs.getProperty('gcs.casemgmt.email.sendFrom', 'xxx3.0');
    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 runs on a condition when  body text contains *work_notes*text. I am not updating the state of the record with this inbound. Email just get added to the work_notes section of Incident.

@Anantha Gowrara 

May Be i should put the problem in this way .

 

When an email is received to - Lets say original.email@address.com, The same email should also be sent to  -secondary.address@email.com - who is the watch list of the Incident.

Hope I am clear now.

Sndeveloper Adm
Tera Guru

@Anantha Gowrara 

Do you have any further inputs on my question above ?