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

No problem! GlideSysAttachment.copy works like this:

  1. Param 1 - What table is the attachment to copy on? (Displayed on the Table Name column of the sys_attachment table)
  2. Param 2 - What record sys_id is the attachment to copy on? (Displayed on the Table Sys ID column of the sys_attachment table)
  3. Param 3 - What table is the attachment being copied to? (For your use case, either problem or change_request depending on which table you are writing the BR for)
  4. Param 4 - What record sys_id is the attachment being copied to? (The sys_id of the problem or change_request record)
  5. NOTE: If you place the attachment in the sys_attachment table and do not want it on any specific record, set the Table Name and Table Sys ID fields of the attachment record to something that the GlideSysAttachment.copy() function can find such as Table Name = CopyMe and Table Sys ID = copy_me_sys_id.

Examples: GlideSysAttachment.copy('kb_knowledge','ka32digitsysid','change_request',current.getUniqueValue());

This would copy from the kb_knowledge record to the change_request record.

 

GlideSysAttachment.copy('CopyMe','copy_me_sys_id','change_request',current.getUniqueValue());

This would copy from a non-existent table and record to the change_request record.

Claude E. D'Amico, III - CSA