Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Auto populate assignment group on incident form depend on the catalog item variable selection

Arjun Reddy Yer
Mega Sage

 

Required help @Vasantharajan N @Tanaji Patil 

Need to auto populate assignment group on incident form depend on the catalog item variable selection.

As when the user select an option from the drop down list on service portal page of a catalog item it should auto assign to a group based on the selected option.

 

On Service Portal:

ArjunReddyYer_0-1701858825214.png

Selection of Option from Dropdown list

ArjunReddyYer_1-1701859033581.png

Incident Form:

 

ArjunReddyYer_2-1701859379546.png

 

1 ACCEPTED SOLUTION

Try adding logs and see what are the logs;

var issueArr1 = ['telephony_application_access','Calls_quality_dropout','CUIC_reporting_dashboards', 'call_recording', 'add_modify_ccess', 'other_issue'];
// use array for more that 2 values to reduce code length
gs.info('ABC  my_telephony_issue_about = '+producer.variables.my_telephony_issue_about);
gs.info('ABC isPart of Issue arr = '+issueArr1.indexOf(producer.variables.my_telephony_issue_about) > -1);
if (issueArr1.indexOf(producer.variables.my_telephony_issue_about) > -1) {
gs.info('Inside Array 1 for group c3538fd81b493dd481df65f1f54bcb4f');
    current.assignment_group = 'c3538fd81b493dd481df65f1f54bcb4f';
}
if (producer.variables.my_telephony_issue_about == 'call_capture') {
    current.assignment_group = 'd7e483d01b893dd481df65f1f54bcb86';
};
if (producer.variables.my_telephony_issue_about == 'alvaria_workforce_management') {
    current.assignment_group = '97677a80dba7a5148837aa4dd396194c';
}
Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

10 REPLIES 10

Anil Lande
Kilo Patron

Hi,

You can use Record Producer script part to add assignment group.

use below logic in record producer script:

if(producer.variables.my_telephony_issue_about == 'choice_value'){
current.assignment_group = 'sys_id of your group';
}
Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

it's working for only one option

actually based on below choice option group should auto select @Vasantharajan N 

Choice OptionGroups
*Telephony Application AccessIT INFRASTRUCTURE - TELEPHONY-INC PBM SUPPORT
*Calls Quality or DropoutIT INFRASTRUCTURE - TELEPHONY-INC PBM SUPPORT
*CUIC Reporting/DashboardsIT INFRASTRUCTURE - TELEPHONY-INC PBM SUPPORT
*Call Info CaptureLEGACY APPS SUPPORT-INC PBM SUPPORT
*Call RecordingIT INFRASTRUCTURE - TELEPHONY-INC PBM SUPPORT
*Add-Modify AccessIT INFRASTRUCTURE - TELEPHONY-INC PBM SUPPORT
*Alvaria Workforce ManagementWORKFORCE PLANNING-INC PBM SUPPORT
*Other IssueIT INFRASTRUCTURE - TELEPHONY-INC PBM SUPPORT

 

Hi,

Can you please share what you have tried and where it is failing?

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

tried with below script

if(producer.variables.my_telephony_issue_about == 'telephony_application_access' || 'Calls_quality_dropout' || 'CUIC_reporting_dashboards' || 'call_recording' || 'add_modify_ccess' || 'other_issue'){
current.assignment_group = 'c3538fd81b493dd481df65f1f54bcb4f';
}
if(producer.variables.my_telephony_issue_about == 'call_capture')
{
current.assignment_group = 'd7e483d01b893dd481df65f1f54bcb86';
};
if(producer.variables.my_telephony_issue_about == 'alvaria_workforce_management')
{
current.assignment_group = '97677a80dba7a5148837aa4dd396194c'; 
}