Copy fields from Securkty Incident to Response Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 04:47 AM
I have two tables: Security Incident and Response Tasks.
There are about 20 fields I want to copy down to the response task when created. What is the best way to relate the two to be able to add the fields to the response task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 04:56 AM
Hi @Community Alums
I think the best way to create property and call that property in UI action, like we have on Incident table , copy incident.
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]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 04:59 AM
@Community Alums
You can follow below approach:
Create a Reference Field:
- In the Response Tasks table, create a reference field that refers to the Security Incident table. This will establish a relationship between the two tables.
Configure the Reference Field:
- Configure the reference field to point to the Security Incident table. This can be done by setting the "Reference" field on the reference field configuration.
Create Business Rule:
- Create a business rule on the Response Tasks table that triggers when a new record is inserted.
- In the business rule script, use the GlideRecord API to query the corresponding Security Incident record and copy the desired fields.
Example Business Rule Script:
(function executeRule(current, previous /* , gs */) {
if (current.operation() == 'insert') {
var securityIncident = new GlideRecord('security_incident');
if (securityIncident.get(current.security_incident)) {
// Copy fields from Security Incident to Response Task
current.field1 = securityIncident.field1;
current.field2 = securityIncident.field2;
// ... copy other fields as needed
}
}
})(current, previous);
Please mark my response correct/helpful, if it helps you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 07:07 PM
@Community Alums
If my response is useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 04:59 AM
Hi @Community Alums,
You can read the incident data and pass the values to response task in the same process which is creating this response task, this incident & response task must be related using some column on response task table(form).
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution