The CreatorCon Call for Content is officially open! Get started here.

How to copy "assigned to" from old case to new case in transfer of HR case

sri vijaya
Tera Contributor

Hi,

We have a requirement where, if HR case is transferred from old case to new case, if assignment group is same  then assigned to filed should copy from old case to new case, or else assigned to should not copy

so what is the best practice to follow this is that a business rule or any other process

 

@Ankur Bawiskar   @Dr Atul G- LNG 

@bhuvan 

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@sri vijaya 

you can use after insert business rule and when it runs on HR case do this

-> see if this new record is copied from some HR case

-> If yes then check if the assignment group is same as the group of the copied HR case

-> if yes then update the group using current.update() and remember to use current.setWorkflow(false)

šŸ’” If my response helped, please mark it as correct āœ”ļø and close the thread šŸ”’ — this helps future readers find the solution faster! šŸ™

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Wessel van Enk
Tera Guru
Tera Guru

Hi @sri vijaya,

Based on your requirement, the best practice would be to implement this logic using a Business Rule. 
You could add for example this script:

if (current.assignment_group == previous.assignment_group) {
current.assigned_to = previous.assigned_to;
} else {
current.assigned_to = ''; // or leave unchanged
}

 

Please keep in mind that you need to test this, as when transferring a case and you keep the same HRC number it still changes the sys_id of the record. 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @sri vijaya 

I don’t think the Assigned To field gets copied. There could be several reasons why an old case triggers a new case — for example, the previous assignee might be on leave, have left the company, or moved to another department. This might explain why, when you copy an incident, only the Assignment Group is copied and not the Assigned To.

*************************************************************************************************************
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]

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