- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 12:57 PM
My assignment groups are not showing up for problems. How do I populate the same assignment groups for problem that i have setup for incidents.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 02:56 PM
Hi David,
There is a field called "Type" on the Group form. Press the security lock icon next to it and you'll see a search box. Type in "Problem" and then select to add as a group "Type". Press the security lock icon to close the type box then Save the group record.
Navigate to the Problem table and check if the group you just assigned the "Problem" type is now showing as an assignment group.
Brent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 01:25 PM
Hi David,
Take a look at the "BackFillAssignmentGroup" script include (used to override the reference qualifier). You need to review the "BackFillAssignmentGroup" function in this script include for any logic that would prevent the groups from being properly displayed in tables other than "incident".
Is it possible to post the script include for me to take a look at?
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 01:35 PM
var BackfillAssignmentGroup = Class.create();
BackfillAssignmentGroup.prototype = {
initialize: function() {
},
BackfillAssignmentGroup:function() {
var gp = ' ';
var a = current.assigned_to;
var groupType = returnGroup();
//If there is no name in the assigned_to field then just display a list of all groups with the right type.
if (!a) {
var gr = new GlideRecord('sys_user_group');
gr.addQuery('type','CONTAINS',groupType);
gr.query();
while(gr.next()) {
if (gp.length > 0) {
//build a comma separated string of groups if there is more than one
gp += (',' + gr.sys_id);
}
else {
gp = gr.sys_id;
}
}
return 'sys_idIN' + gp;
}
//If there is a name in the assigned to then return only those groups that they are a part of which also matches the group type.
else {
//sys_user_grmember has the user to group relationship
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('user',a);
grp.query();
while(grp.next()) {
if(grp.group.type.indexOf(groupType) > -1){
if (gp.length > 0) {
//build a comma separated string of groups if there is more than one
gp += (',' + grp.group);
}
else {
gp = grp.group;
}
}
}
return 'sys_idIN' + gp;
}}
}
//And here is the returnGroup function portion:
function returnGroup() {
var tt = current.getTableName();
var type = '';
var tableTypes=[];
tableTypes[0] = {table:'incident', typeID:'d6c18d456f83c100ad775ddd5d3ee4bb'};
tableTypes[1] = {table:'sc_task', typeID:'74af88c6c611227d0066386e74dc853d'};
tableTypes[2] = {table:'task', typeID:'74af88c6c611227d0066386e74dc853d'};
tableTypes[3] = {table:'problem', typeID:'c8d18d456f83c100ad775ddd5d3ee4c7'};
tableTypes[4] = {table:'problem_task', typeID:'c8d18d456f83c100ad775ddd5d3ee4c7'};
tableTypes[5] = {table:'change_request', typeID:'d6d18d456f83c100ad775ddd5d3ee4ec'};
tableTypes[6] = {table:'change_task', typeID:'d6d18d456f83c100ad775ddd5d3ee4ec'};
tableTypes[7] = {table:'rm_sprint', typeID:'1bff3b1493030200ea933007f67ffb6d'};
tableTypes[8] = {table:'rm_story', typeID:'1bff3b1493030200ea933007f67ffb6d'};
for(j = 0; j < tableTypes.length; j++){
//Loop through list of tableTypes
if(tableTypes[j].table == tt){
type = tableTypes[j].typeID;
break;
}
}
if(type != ''){
return type;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 01:41 PM
The change table works correctly. Any idea why Problem not working?
var BackfillAssignmentGroup = Class.create();
BackfillAssignmentGroup.prototype = {
initialize: function() {
},
BackfillAssignmentGroup:function() {
var gp = ' ';
var a = current.assigned_to;
var groupType = returnGroup();
//If there is no name in the assigned_to field then just display a list of all groups with the right type.
if (!a) {
var gr = new GlideRecord('sys_user_group');
gr.addQuery('type','CONTAINS',groupType);
gr.query();
while(gr.next()) {
if (gp.length > 0) {
//build a comma separated string of groups if there is more than one
gp += (',' + gr.sys_id);
}
else {
gp = gr.sys_id;
}
}
return 'sys_idIN' + gp;
}
//If there is a name in the assigned to then return only those groups that they are a part of which also matches the group type.
else {
//sys_user_grmember has the user to group relationship
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery('user',a);
grp.query();
while(grp.next()) {
if(grp.group.type.indexOf(groupType) > -1){
if (gp.length > 0) {
//build a comma separated string of groups if there is more than one
gp += (',' + grp.group);
}
else {
gp = grp.group;
}
}
}
return 'sys_idIN' + gp;
}}
}
//And here is the returnGroup function portion:
function returnGroup() {
var tt = current.getTableName();
var type = '';
var tableTypes=[];
tableTypes[0] = {table:'incident', typeID:'d6c18d456f83c100ad775ddd5d3ee4bb'};
tableTypes[1] = {table:'sc_task', typeID:'74af88c6c611227d0066386e74dc853d'};
tableTypes[2] = {table:'task', typeID:'74af88c6c611227d0066386e74dc853d'};
tableTypes[3] = {table:'problem', typeID:'c8d18d456f83c100ad775ddd5d3ee4c7'};
tableTypes[4] = {table:'problem_task', typeID:'c8d18d456f83c100ad775ddd5d3ee4c7'};
tableTypes[5] = {table:'change_request', typeID:'d6d18d456f83c100ad775ddd5d3ee4ec'};
tableTypes[6] = {table:'change_task', typeID:'d6d18d456f83c100ad775ddd5d3ee4ec'};
tableTypes[7] = {table:'rm_sprint', typeID:'1bff3b1493030200ea933007f67ffb6d'};
tableTypes[8] = {table:'rm_story', typeID:'1bff3b1493030200ea933007f67ffb6d'};
for(j = 0; j < tableTypes.length; j++){
//Loop through list of tableTypes
if(tableTypes[j].table == tt){
type = tableTypes[j].typeID;
break;
}
}
if(type != ''){
return type;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 01:58 PM
Hi David,
In the returnGroup function there are some stipulations around "typeID" that must be added to the groups to be shown on each table. The sys_id of the group type is 'c8d18d456f83c100ad775ddd5d3ee4c7' for the problem table. Check which group type this sys_id belongs to by typing the following in the "Filter navigator" and hitting enter.
sys_user_group_type.LIST
Then use the condition builder to find the group "type" that needs to be added to groups that can be assigned problem tickets
Add the appropriate group type to the groups and they should then start showing up as assignment groups on the problem table:
Let me know if that worked for you.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 02:45 PM