Create an inbound email action to put the subject in short description.

Bharath kumar6
Tera Expert

I need to create an inbound email action so that it creates a record in change request table.

Subject - short description of change request.

Body - Description.

Attachments in email - attachments in change request.

 

Please guide me how to achieve this.

1 ACCEPTED SOLUTION

it should not be twice

small update

GlideSysAttachment.copy('sys_email',sys_email.sys_id,'change_request',current.sys_id);

OR

current.insert();

GlideSysAttachment.copy('sys_email',sys_email.sys_id,'change_request',current.sys_id);

current.update();

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

16 REPLIES 16

If this email inbound action has to execute if the email is coming from 'bharath123@gmail.com'.

How do I put this condition AND

If the attachments are coming from email then those attachments has to be in the change request record's attachments.

Hi,

in inbound action use this; it would run only when it comes bharath123@gmail.com

if(email.origemail.indexOf('bharath123@gmail.com') != -1){
	
// your logic here

}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Okay.

Can you please answer this.

If the attachments are coming from email then those attachments has to be in the change request record's attachments.

should happen directly

if not then use this script

GlideSysAttachment.copy('sys_email',current.sys_id,'change_request',current.sys_id);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Used this

Still not working

find_real_file.png

find_real_file.png

 

It is creating the record but the attachments are not transferring to this target record.