- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 05:21 AM
Hi,
I have a table where i want to copy the attachment to Security incident from Security request.
In Security request we have a UI action called " convert to security incident" once it is converted Security incident will be created and the attachment to be copied over.
I tried using After -insert BR. but its not working . ANywhere im goin wrong? can anyone suggest on this
Here is the code which i tried
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 08:43 AM - edited 11-25-2024 08:44 AM
Hello @NAIDILE S ,
Please try This After insert Business Rule:
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Pooja.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 05:43 AM
Hi @NAIDILE S ,
In UI Action you can try below code.
var grIncident = new GlideRecord('sn_si_incident'); // Table name for Security Incident
grIncident.initialize();
grIncident.short_description = current.short_description;
grIncident.description = current.description;
grIncident.insert();
// Copy attachments
var attachment = new GlideSysAttachment();
attachment.copy('security_request', current.sys_id, 'sn_si_incident', grIncident.sys_id);
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 08:51 PM
Thanks for the solution,using BR it worked for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 09:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2024 09:21 PM
Hi,
UI action which is present is OOTB and we cannot customize it. so went with the BR
and for every insert of SIR(security incident) from Security Request(from UI action "convert to security incident) a new SIR will be created