How to autopopulate assigned to and assignment group with created by details in incident

Priyanka77
Tera Guru

Hi,
I need to auto populate assignment group with default group field(custom) of creator(sys_created_by) and assigned to field with creator name.

Can someone please help me with this requirement.

Thanks in advance

Priyanka

1 ACCEPTED SOLUTION

Thanks @Nilesh Pol1 
Script should be dynamic and its should work for all assignment group and assigned to is not caller instead its a created by(field). 
After BR worked well after glide record of user table and update.

View solution in original post

4 REPLIES 4

AnubhavRitolia
Mega Sage
Mega Sage

Hi @Priyanka77 

 

Try Insert After Business Rule as below:

 

 

current.assignment_group = current.sys_created_by.<Default Group field>;
current.assigned_to = current.sys_created_by;

current.update(); // Avoid it as not recommended but something does not work without it than try and see

 

Or your can try to achieve it without script also from Action section as below:

 

AnubhavRitolia_0-1692704789386.png

 

You can use your Default Group field instead of Domain. It was just for your reference.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Thanks for your response.
sys_created_by field is read only and not a reference type in incident and showing user id of creator not a name.
And in actions you have mentioned caller but i need to autopopulate creator details not caller.

Thanks,
Priyanka 

Nilesh Pol1
Giga Guru

Hi @Priyanka77 ,

As per the best practice you can achieve this using customizing DBR.

Write an Display BR on required form(e.g. incident).

In action tab Set field values as per the scan attached. 

NileshPol1_0-1692707490797.png

mark this helpful if this help you to reach towards solution.

 

Thanks.

Thanks @Nilesh Pol1 
Script should be dynamic and its should work for all assignment group and assigned to is not caller instead its a created by(field). 
After BR worked well after glide record of user table and update.