Need an attachment to be available in a problem record

ServiceNow10sun
Giga Guru

Hi All , 

 

My requirement is i want a file example abc.csv should be always available in a problem record when any user create a new problem record , as i want the user to download it fill it and re attachment it. 

 

Please suggest how to do this.

4 REPLIES 4

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can upload attachment in sys_attachment table and then create a before business rule on incident table to copy attachment from sys_attachment table to incident table with the help of GlideSysAttachment | ServiceNow Developers

-Anurag

Below is my script which i wrote in before BR  but its not working , any suggestions please
 
(function executeRule(current, previous /*null when async*/) {

    // Add your code here
 
    var attachmentSysID = '6924836797608210f9efbc400153afbe';
   
    var attachmentSysID = GlideSysAttachment.copy('sys_attachment', attachmentSysID, 'problem', current.sys_id);
   
})(current, previous);

Change it to after BR , It should work then.

-Anurag

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @ServiceNow10sun 

 

https://www.servicenow.com/community/developer-forum/how-to-add-a-attachment-by-default-to-all-new-r...

 

https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/use/using-forms/task/t_...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************