Assignment rules for record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 02:59 PM
Hi,
we have a record producer "com incident", mapped to incident table.
We need to leverage the assignment rules table to validate the CI and record producer name.
ex: If the CI is "dell laptop" and record producer is "com incident", then the incident should route to "Hardware" assignment group
How can i validate the record producer name and CI name in the assignment rules table and set the assignment group?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 07:05 PM
Hello @imran sk
Are you already collecting CI information in your records producer from users ?
If yes, please add below 👇 script in your records producer -
// Set Assignment Group based on selected CI
var ci = producer.cmdb_ci;
if (ci == 'YOUR_CI_SYS_ID') {
current.assignment_group = 'YOUR_ASSIGNMENT_GROUP_SYS_ID';
}
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 08:14 PM
you cannot access the record producer name in assignment rule script.
Better to use record producer script itself to set the Group
OR
you can use Before insert business rule and check if record was generated from which record producer, check this table "sc_item_produced_record"
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:14 PM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:09 PM
Hi @imran sk
Your requirement cannot be fulfilled with Assignment Rules. You can create a Before Insert Business Rule on sc_item_produced_record table as suggested by @Ankur Bawiskar. Refer below screenshots for reference:
(function executeRule(current, previous /*null when async*/ ) {
var incGr = new GlideRecord('incident');
incGr.get(current.task);
incGr.query();
if (incGr.next()) {
incGr.assignment_group = '8a5055c9c61122780043563ef53438e3'; //Change the sys_id as per the assignment group required
incGr.update();
}
})(current, previous);
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.