Assignment group Auto-populate based on the caller's assigned groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 06:34 AM
Hi,
When I'm creating an incident record, I want the Assignment based on the logged in users Assignment group. I want the assignment group to auto-populate based on the logged-in user's or caller's assignment group. If there are multiple groups, it will show all groups available for selection in the alphabetical order. How to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 07:14 AM
Yes you do. You can go to the people giving you this requirement and explain them that the requirement doesn't make sense. If you can't explain that to them, you don't have a grasp on the requirement and you are just doing what they tell you, which is the worst possible way of developing on the platform.
You are the person that needs to protect the platform/process owners from making mistakes. And this is a huge one.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 07:05 AM
Hi Nisha,
I agree with the people in this forum. As per ITIL best practises , this requirement is not making sense . There is no harm in asking questions that clarifies the requirement . It would make more sense if the assignment group are based on user's location.
//Shivambi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 07:10 AM
Hi @NishaB ,
You can use reference qualifier to call script include which will return list of sysids which belongs to logged in user.
I have written code which will return groups based on logged in user you can pass the caller to script include to get the group.
Reference qualifier:
javascript:"sys_idIN"+ new global.getMyGroup().getAllGroup();
Script include:
var getMyGroup = Class.create();
getMyGroup.prototype = {
initialize: function() {},
getAllGroup: function() {
var currentUserId = gs.getUserID();
var groupSysIds = [];
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', currentUserId);
gr.query();
while (gr.next()) {
groupSysIds.push(gr.group.toString());
}
return groupSysIds;
},
type: 'getMyGroup'
};
Result:
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------