I need to add a document attached to my change and problem tickets when the user open new ticket

siddharth26
Tera Guru

Hi,

I need a document to be attached automatically to my change and problem request when user creates new change and problem tickets , so that user can download and fill the details in change and problem tickets.

 

thanks

 

5 REPLIES 5

Anil Lande
Kilo Patron

Hi,

Please follow below steps:

1. Create new attachment record in sys_attachment table copy sys_id of record and use it in below script.

2. Create after insert business rule on both tables (change and problem) and  use below script:

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

GlideSysAttachment.copy('sys_attachment', <sys_id of attachment record>, 'problem', current.sys_id);  // if BR is on problem

})(current, previous);

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Thanks

for the response 

could you please help me am using the BR 

 

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

// Add your code here

GlideSysAttachment.copy('sys_attachment','40f93e16c0a801130137c1f1bf538539');

})(current, previous);

Claude DAmico
Kilo Sage

You could try a Business Rule when the records are inserted to copy attachments using GlideSysAttachment.copy('from_table', 'from_record_sys_id', 'to_table', 'to_record_sys_id'). You should be able to house the attachment in any record by itself for this purpose. For example, an empty knowledge article for this specific use case.

Claude E. D'Amico, III - CSA

Thanks

for the response 

could you please help me am using the BR 

 

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

// Add your code here

GlideSysAttachment.copy('sys_attachment','40f93e16c0a801130137c1f1bf538539');

})(current, previous);