Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

Hi,

use this along with that line

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

current.update();

Regards
Ankur

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

Hi,

still it is not working

Hi,

try this

current.insert();

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

current.update();

Regards
Ankur

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

It's not working and in the script you are putting current.sys_id twice.

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