Add External user email to watchlist

surbhi_123
Tera Expert

I have created an inbound action where the use case is that an incident will be created automatically whenever any email is sent to the email address 'test@dxc.com'. I want to add the email address of the users into watch-list of incident who sends mail to  'test@dxc.com' if user is an external user .

I am using the following code but it is not working

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

// Implement email action here

current.assignment_group='00a5903287782110a37beced8bbb3587';
current.short_description = email.subject;

current.cmdb_ci='545ebad20fe66e407492c4dce1050e65';
current.description = "received from: " + email.origemail + "\n\n" + email.body_text;


if (current.opened_by.name.toLowerCase() == 'guest'){
current.watch_list = (email.recipients + "," + email.origemail);
} else {
current.opened_by == 'sys_user';
current.watch_list = email.recipients;
}


current.insert();

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

 

surbhi_123_0-1677752949903.png

 

0 REPLIES 0