Populate auto assignment group on incident form through record producer

Madhan27
Mega Guru

HI community,

 

I got stuck with an requirement,  where I created a record producer on alert table. When the record producer is updated it will create a record in the "Alert" table. There it will create the incident record as well.

 

I am trying to auto populate the assignment group of the incident record as per the below condition. 

 

  • When the source on the alert table is zabbix. 

 

Madhan27_0-1715106083518.png

 

  • Accordingly it has to populate the assignment group on the incident form as Zabbx.L1 (Group exists)

Madhan27_1-1715106224378.png

 

Need some hints on it, I guess it can be done on BR and client scripts. What's the best practice and need some help on the scripting as well.

 

TIA

#Recordproducer #AlertTable #AutoAssignmentGroup

1 ACCEPTED SOLUTION

Madhan27
Mega Guru
 
Thank You for your response, The ask was achieved with the business rule with the below following script which i used. 
 
(function executeRule(current, previous /*null when async*/ ) {

 

    var grInc = new GlideRecord('incident');
    grInc.addQuery('sys_id', current.incident); //backend name of 'Task' Field

 

    grInc.query();
    if (grInc.next()) {
        var grGroup = new GlideRecord('sys_user_group');
        grGroup.addEncodedQuery('nameSTARTSWITH' + current.source); //backend name of 'Task' Field

 

        grGroup.query();
        if (grGroup.next()) {
            grInc.setValue('assignment_group', grGroup.getUniqueValue());
            grInc.update();
        }
    }




})(current, previous);

View solution in original post

12 REPLIES 12

Anand Kumar P
Giga Patron
Giga Patron

Hi @Madhan27 ,

 

You can achieve this by creating a Business Rule on the Alert table. The BR will trigger when a new record is inserted and the source is 'zabbix'. Then in br script update the related incident's assignment group to 'Zabbix.L1'.

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

Madhan27
Mega Guru

what if we have multiple sources??? According to the source I have to populate the assignment group. @Anand Kumar P 

 

swathisarang98
Giga Sage
Giga Sage

Hi @Madhan27 ,

 

You can achieve this after Insert BR but before glide recording to Incident record and updating Assignment rule there should be relationship between Incident table and alert table, so could you please let me know if there is any field in incident which stores alert number ?

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Yes, There's a relation b/w the incident and alert table. On alert record the incident number will acknowledge on the task field as you can see in the first screen shot. @swathisarang98