Send Catalog Item Attachment with Notification

Community Alums
Not applicable

Hello,

We have a catalog task notification that gets sent out when the catalog task is created.   I would like to add any attachments the user attached during item submission.   I have checked the include attachments but no luck.  Any assistance is appreciated.

Thanks,

Chad

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

that won't work as that checkbox will support only when file is present on catalog task

you need to copy file from RITM to SC Task when it gets created and ensure Include Attachment checkbox = True

you can use before insert BR on sc_task and copy that

Condition: current.request_item.cat_item.name == 'Your Catalog Item Name Here'

Script:

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

	// Add your code here
	GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);

})(current, previous);

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

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

that won't work as that checkbox will support only when file is present on catalog task

you need to copy file from RITM to SC Task when it gets created and ensure Include Attachment checkbox = True

you can use before insert BR on sc_task and copy that

Condition: current.request_item.cat_item.name == 'Your Catalog Item Name Here'

Script:

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

	// Add your code here
	GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);

})(current, previous);

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

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

Community Alums
Not applicable

@Ankur Bawiskar 

Hello, Appreciate the response.   Works but getting duplicate attachments at ritm due to the business rule attached.   Is there a way to put an exception in this rule for one catalog item?

Thanks,

Chad

@Community Alums 

the approach I mentioned is Before Insert BR on SC Task and not sys_attachment

Please use the same

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

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