How to route all orphaned tickets back to group.

Kaleem Shaik
Tera Contributor

Hi All,

 

How to route all orphaned tickets (assigned to groups / users who don't have roles) back to their original groups?

@Ankur Bawiskar @abirakundu23 

1 ACCEPTED SOLUTION

Hi @Kaleem Shaik 

 

Do this via Flow Designer

 

Trigger

Schedule

 

Action

Look up for records

where Inc.assignemnet group is empty ( or as per conditions)

 

Logic

For each 

Action

Update record

Assignment group = SD

For each record

 

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

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

View solution in original post

9 REPLIES 9

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Kaleem Shaik 

I think best way is if it orphan assign to SD group so that team assign to rigtt team.

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

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

Hi @Dr Atul G- LNG 

Instead of assigning to SD group manually.

can we assign it to group by using script?

Hello @Kaleem Shaik ,

 

Try below after create/update business rule with condition assigned to is not empty and use below script for future incidents and use below script in fix script to route all current orphaned tickets(assigned to users

who don't have roles back to their original groups

var t = current.assigned_to;

var userrole = new GlideRecord('sys_user_has_role')

userrole.addQuery('user',t)

userrole.addQuery('role','sys_id of the role')// 

userrole.query()

if(!userrole.next())

{

current.assigned_to='';

current.setWorkflow(false);

current.update();

}

 

if it helps kindly click on helpful and mark it as accepted solution

 

Hi @siva krishna M2 

This above script is not working.