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.

Add attachments to the email function from the existing incident record.

Khalnayak
Kilo Sage

Hi,

I have a requirement to allow users to add attachments from the existing incident record when using the email function.

I have come across articles, which leverage before BR and attaches all the attachments to the email.

I do not want that, In the email when i click on the attachment icon, I should see all the attachments from the incident there.

Also I have seen BR scripts which duplicate the attachment when sent.

Please help.

1 ACCEPTED SOLUTION

can you try with below code. 

 

After "Insert" business rule on "sys_email" table .

 

script:

 

(function executeRule(current, previous /*null when async*/) {

	// Add your code here

	GlideSysAttachment.copy(current.target_table,  current.instance ,'sys_email', current.sys_id);


})(current, previous);

 

See if its not creating duplicate attachment on email client. 

View solution in original post

20 REPLIES 20

@Ankur Bawiskar 

Hi,

As per the article it would attach the attachments to email client

For removing duplicates possibly you will have to delete older ones

Regards
Ankur

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

and what about auto attaching the attachments? how can we stop that?

Hi,

I didn't get the part.

You want attachments to be copied over the email client right

Regards
Ankur

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

Jaspal Singh
Mega Patron
Mega Patron

Hi Usmaan,

 

Unsure if you have gone through article. You can refer once as it will populate all attachments & you have an option to remove. I

f that does not help then you will have to go with lot more customized approach.