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

Khalnayak
Tera Guru

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

Jaspal Singh
Mega Patron
Mega Patron

Hi Usmaan,

 

I remember commenting on this thread strangely cannot find my comments. Did you check article link as proivded in comments before. It will copy all attachments & in case you will to remove you can remove it by clicking the Attachment icon.

Unsure if you requirement is something different.

Khalnayak
Tera Guru

so if you look at the screenshot below, you can see I only have 2 attachments in the incident, but when copied to mail client, it shows duplicates.

find_real_file.png

 

However, I do not want attachments to show there automatically, I want them to only show when I click the attachment icon as below, and then I should be able to choose which attachments I want to  attach.

find_real_file.png

@Jaspal Singh  yes I do remember you commenting but it somehow disappeared.

Please can you help on this.

@Mark Roethof @asifnoor @Ashutosh Munot @Harshvardhan 

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. 

Hi Harshvardhan,

 

Thanks duplicates are no longer showing now.

Now is there a way to not have the attachments attach when automatically, so i get to choose which atachments I want to send with the email by clicking on the attachment icon.

Or is that not possible? because it is not ideal to send all attachments with every email.