- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 11:26 AM
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.
- Accordingly it has to populate the assignment group on the incident form as Zabbx.L1 (Group exists)
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 11:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 12:54 PM
Hi @Madhan27 ,
Okay Then you can create after insert Business rule and in advanced script write the code as below,
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('incident');
gr.addQuery('sys_id',current.u_task); //backend name of 'Task' Field
gr.query();
if(gr.next()){
gr.assignment_group = '287ee6fea9fe198100ada7950d0b1b73'; // sys id of Group
gr.update();
}
})(current, previous);
Note: Update the backend names according to yours
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 01:23 PM - edited 05-07-2024 01:24 PM
Ty for your response @swathisarang98 , But you are hard coding the value over there. Ask is that
for ex : On alert table source = 123
On incident table assignment group has to look up for the 123 group
On alert table source = 456
On incident table assignment group has to look up for the 456 group
Can you change the script accordingly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 01:49 PM - edited 05-07-2024 01:55 PM
Hi @Madhan27 ,
So source field stores the name of the assignment group ? if not not could you please tell me how many sources are there or can you tell me whether assignment group will have same name as source field value or start with source name value ?
Thanks
Swathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 05:23 AM
Hi @swathisarang98 No source feild wont have the assignment group details. But the assignment group name can start with the source name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 06:18 AM
@Madhan27 is there a possibility that there might be multiple group which start with same source name example Zabbix.L1, Zabbix.L2 something like this or only one will be available ? because if there will be multiple assignment group starting with same name as source then it will be difficult to identify which assignment group should be set dynamically,
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang