how to copy over assign to and assignment group from primary ticket incident to universal request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 05:41 PM - edited 04-14-2024 05:43 PM
Hi guys,
When creating a ur and create and incident from the ur. I need to copy some infos when the incident get closed.
I'm trying to copy over the assign to and assignment group when the incident state is closed to the ur.
So both primary incident ticket and ur gets the same info
I did multiple try of business rules but it does not work
any tips ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 10:05 PM
Hi,
Could you please share your code here.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2024 10:15 PM
Could you please share your script, meanwhile you can follow below sample script:
(function executeRule(current, previous /*null when async*/) {
// Check if the incident state has changed to "Closed"
if (current.state == '7') { // '7' represents the 'Closed' state in the Incident table
// Get the parent UR record
var ur = new GlideRecord('sc_request');
ur.get('sys_id', current.parent.sys_id); // Assuming the parent field is 'parent' and contains the UR's sys_id
if (ur.isValid()) {
// Copy assign to and assignment group information from the closed incident to the UR
ur.assignment_group = current.assignment_group;
ur.assigned_to = current.assigned_to;
ur.update();
}
}
})(current, previous);
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 06:29 AM
Do i need to put something in the when to run field ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2024 01:38 AM
Hi @flsn2
Is something at property level did you check.
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]
****************************************************************************************************************