How can I add attachments to change templates?

vimalchandra
Kilo Contributor

Hi ServiceNow community,

I've created change templates however when creating a change request, I would like to attach client change documents to the change request so they are attached automatically.

In the template, I did attempt to attach the document however it did not reflect when creating the change request.

Is this something possible to do in ServiceNow? If so, how can I achieve this?

Thanks,

Vimal

1 ACCEPTED SOLUTION

srinivasthelu
Tera Guru

HI Vimal,



This possible, but requires a Business Rule to be created on Change Request table.



screenshots below:




Capture1.JPGCapture3.JPG




BR code for convenience:



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




GlideSysAttachment.copy(current.std_change_producer_version.std_change_producer.getRefRecord().getTableName()+'',current.std_change_producer_version.std_change_producer.sys_id+'', current.getTableName(), current.getValue('sys_id'));



})(current, previous);


View solution in original post

6 REPLIES 6

hi Srinivas,


I am facing the same problem, is there any solution already in place.

 

Regards,

Kalpana

it's not working same code for me