Inbound Action: When CC has a Value

TStark
Kilo Sage

I have an inbound action that creates an incident and assigns that incident to a specific group when a specific email address (i.e. email.address@domain.com) is the recipient.  The problem is when there is a different email address in the CC in addition to 'email.address@domain.com' in the To field the incident is created, but not assigned to the specified group. Below is the part of the script used to assign the incident.

 

    if (email.recipients == 'email.address@domain.com') {
        current.assignment_group = '------------------------'; //sys_id of the assignment group
        current.impact = 1;
        current.urgency = 2;
    }
 
Thanks,
AJ
2 REPLIES 2

ahefaz1
Mega Sage

@TStark ,

email.recipients - Contains a comma-separated list of recipient addresses as a plain text string, in the To: box.

Can you try below

 

if(email.recipients.indexOf('email.address@domain.com')>-1){

  current.assignment_group = '------------------------'; //sys_id of the assignment group
        current.impact = 1;
        current.urgency = 2;
}

 

Please mark helpful, if this helped.

 

Thanks,

 

 

Sainath N
Mega Sage
Mega Sage

@TStark : Could you try replacing '==' with 'indexOf' in your if condition, as in this case recipients hold multiple email addresses.

 

email.recipients.indexOf('email.address@domain.com')>-1

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.