How to auto populate assignment group name in catalog form created through record producer

Naresh_5120
Tera Contributor

Dear Community,

 

I have created a record producer catalog form to create an incident in incident table. my requirement is to autopoplate the assignment group variable with assignment group name based on caller's location managed by group field. Example if caller is abraham.lincoln then the assignment group should auto populate as Service Desk (assignment group name). if managed by group field is blank in cmn_location table, then by default the assignment group should be local support team (assignment group name). can someone help me to achieve this outcome.

 

Naresh_5120_0-1728979013337.png

Naresh_5120_1-1728979068347.jpeg

 

Regards,

Naresh

2 REPLIES 2

Shruti
Mega Sage
Mega Sage

Hi,

Assignment group can be populated with record producer script itself

var caller = gs.getUserID();

var usr = new GlideRecord('sys_user');
if (usr.get(caller)) {
    if (usr.location.managed_by_group)
        current.assignment_group = usr.location.managed_by_group;
    else
        current.assignment_group = '<sys_id of servicedesk of group>';
}

anshul_goyal
Kilo Sage

Hi @Naresh_5120,

You can utilize ServiceNow's auto-populate feature for your assignment group variable. In the 'Assignment Group' variable, use the 'Auto-populate' section and set the 'Dependent Question' to 'Opened For'. The 'Reference' field should be populated with the sys_user table. You can use the 'Dot Walk Path', such as (location.managed_by_service), and that might work for you.

For Example:

anshul_goyal_0-1728980695023.png


Please mark my solution as Helpful and Accepted, if it works for you in any way!

Thanks