Auto Populate Assignment group based on variable on Record producer

Ankita Gupte
Kilo Sage

Hello Expert,

 

I have look up variable "u_issue_category" on Record Producer report an issue which raises an incident after submitting the form. Issue category variable shows some values but if the value selected is "One" then after submitting the record producer when incident is created and this incident should have assignment group as One Support.

 

Please help with client script to achieve this.

 

 

1 ACCEPTED SOLUTION

Hi @Ankita Gupte ,

I think You no need Business rule also you can check condition on record producer script and give group.

if (producer.u_issue_category == 'One') {
    current.assignment_group = 'da3ef7c69756411051cb341e6253af43'; //add group sysid
}
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

8 REPLIES 8

this is the script which you will write up in the record producer script field, not in client script

Capture91.PNG

Best Regards
Aman Kumar

Pavankumar_1
Mega Patron

Hi @Ankita Gupte ,

Instead of client script you can use Business rule to set group.

1. Create Before insert/update business rule on incident and use below script replace with your field names.

(function executeRule(current, previous /*null when async*/ ) {
    if (current.variables.u_issue_category == 'One') { //add category value
        current.u_customer = 'da3ef7c69756411051cb341e6253af43'; //add One support sysid
    }
})(current, previous);
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Hello Pavan,

 

Thanks for inputs, Is using this business rule approach the correct way?

Hi @Ankita Gupte ,

I think You no need Business rule also you can check condition on record producer script and give group.

if (producer.u_issue_category == 'One') {
    current.assignment_group = 'da3ef7c69756411051cb341e6253af43'; //add group sysid
}
If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar