- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2016 12:11 AM
Hi all,
Just want to start in saying that this could be me confusing myself!
From what I can gather - the best way to assign roles is to assign to groups, and then add the users to those groups.
This is fine and dandy - however we do not want to have these groups as assignment groups.
I followed the below wiki article, and assigned the group type as 'itil' and then modified the Assignment group's dictionary entry to contain type 'itil'
Configuring Group Types for Assignment Groups - ServiceNow Wiki
This works great, and as expected, until someone who is a member of more than one group.
What we have found is if you were to add an assignee in Assigned to before adding an assignment group, it will add the first group they are a member of, whether or not it is an assignment group with the 'itil' type or not.
Does anyone know how I can stop this from happening?
I hope I have explained this well enough......
Thanks in Advance!
Brendan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2016 05:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 05:25 PM
Just wondering if anyone had any insight into this back fill script?
Sorry for the page, but maybe you could point me in the right direction pradeepksharma?
Cheers,
Brendan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 07:27 PM
Hello Brendan,
Sure, can you please copy and paste script include "KSTaskAjax" code here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 07:46 PM
Cheers Pradeep
Script Include:
API Name: global.KSTaskAjax
Client Callable: Yes
Accessible from: All application scopes
var KSTaskAjax = Class.create();
KSTaskAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
});
KSTaskAjax.prototype.checkTaskSLABreached = function() {
return String(KSTaskUtil.isResolveSLABreached(this.getParameter('sysparm_sysID')));
};
// finds a group to default for the current assigned to person
// just picks the first group; user needs to check this before saving
KSTaskAjax.prototype.getPrimaryGroupInfo = function() {
var assignedTo = this.getParameter('sysparm_assignedTo');
var retObj = {};
retObj.groupID = '';
retObj.groupName = '';
retObj.assignedName = '';
retObj.groupCount = 0;
if (assignedTo != '') {
//
// Get the user record
//
var userRec = new GlideRecord('sys_user');
if (userRec.get(assignedTo)) {
retObj.assignedName = userRec.name.toString();
//
// count how many active assignment groups the assigned to belongs to.
// only allow groups: with no type set (signifies assignment group)
// : that are active
//
var memberRec = new GlideRecord('sys_user_grmember');
memberRec.addQuery('user', assignedTo);
memberRec.addQuery('group.active', 'true');
memberRec.addNullQuery('group.type');
memberRec.query();
while (memberRec.next()) {
//
// return the first assignment group encountered to auto populate the group on the task record
//
if (retObj.groupCount == 0) {
if (retObj.groupID == '') {
retObj.groupID = memberRec.group.toString();
retObj.groupName = memberRec.group.name.toString();
}
}
retObj.groupCount++;
}
}
}
var json = new JSON();
var returnData = json.encode(retObj);
return returnData;
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 07:56 PM
Hello Brendan,
To filter records by group type ITIL you have to add the below line after line no 38.
memberRec.addQuery('group.type', ' Copy and Paste ITIL SYS_ID HERE');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2016 08:11 PM
Thanks for this Pradeep,
I am having a hard time where to find the sys id of the group type... Do you know where I can get that?
Cheers,
Brendan