Requires a Business rule to Clear the "Assigned to" field when the Assignment Group changes ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2017 01:31 AM
In an incident form whenever the "Assignment group" changes the "Assign to" field should be cleared, if that assignee doesn't belongs to that group. I required a business rule for aabove requirement.
- Labels:
-
Change Management
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2017 03:26 AM
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var objUserMember = new GlideRecord('sys_user_grmember');
objUserMember.addQuery('user',current.assigned_to);
objUserMember.addQuery('group',current.assignment_group);
objUserMember.query();
gs.log("VAB:DEBUG: "+objUserMember.getRowCount().toString().length);
if(!objUserMember.next())
current.assigned_to = '';
current.update();
})(current, previous);
Mark your feedback( Like or Helpful or Correct) as per the impact of my response. Cheers!
Vab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2017 04:04 AM
Hi Vab Singhal,
Thanks for the update. But it is not working for me..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2017 04:50 AM
instance: https://demonightlyhelsinki.service-now.com/nav_to.do
login id = admin
password = admin
Business Rule:
Test user account: "abel.tuter"
This user "abel.tuter" has got two groups: "Network" and "Database"
Incident assigned to "Network" => "abel.tuter"
Change Assignment Group from "Network" to" Database" and Save =>Assigned to will not clear off
Change Assignment Group from "Database" to "Cab Approval" and save => Assigned To will clear off.
Mark your feedback( Like or Helpful or Correct) as per the impact of my response. Cheers!
Vab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2017 10:51 PM
Did this resolve your issue?
Mark your feedback( Like or Helpful or Correct) as per the impact of my response. Cheers!
Vab