The CreatorCon Call for Content is officially open! Get started here.

How to hide permission group in Assignment group in task table

DeepikaR1661877
Tera Contributor

Hello everyone, 

I have one recruitment, that's in task table assignment group i want only hide the permission group(type is permission) already having the reference qualifier, using script include to call the function, in SI i change the condition but it's not working, below is the SI, here i want to add the condition like i need hide the type is permission, can some help me, 

getAssignmentGroups: function(current) {
        var encodedquery = '';
 
        if (current.getValue('u_type') == 'escalation_task') {
            encodedquery = 'type=' + gs.getProperty('sn_si.sap.sec_inc.escalation_task.allowed.groups');
var sysIdsArray = allowedGroups.split(',');
encodedquery = 'sys_idIN' + sysIdsArray.join(',') + '^type!=permission';
 
        }
 
        return encodedquery;
    },
8 REPLIES 8

Anand2799
Tera Guru

Hi @DeepikaR1661877 ,

 

Try this:

 

getAssignmentGroups: function(current) {
var encodedquery = '';

if (current.getValue('u_type') == 'escalation_task') {
var allowedGroups = gs.getProperty('sn_si.sap.sec_inc.escalation_task.allowed.groups');
var sysIdsArray = allowedGroups.split(',');
encodedquery = 'sys_idIN' + sysIdsArray.join(',') + '^type!=permission';
}

return encodedquery;
}

 

Thanks

Anand

DeepikaR1661877
Tera Contributor

Hi @ Anand2799 ,

It's not working actually, it's allow to save the type is permission groups in assignment group.

@DeepikaR1661877 

Seems you missed my earlier response

AnkurBawiskar_0-1758124631791.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @DeepikaR1661877 ,

 

Updated code: You need to pass sys_id of itil type not string

 

getAssignmentGroups: function(current) {
var encodedquery = '';

if (current.getValue('u_type') == 'escalation_task') {
var allowedGroups = gs.getProperty('sn_si.sap.sec_inc.escalation_task.allowed.groups');
var sysIdsArray = allowedGroups.split(',');
encodedquery = 'sys_idIN' + sysIdsArray.join(',') + '^typeNOT LIKE1cb8ab9bff500200158bffffffffff62^ORtypeISEMPTY;

}

return encodedquery;
}

 

Add this to reference qualifier script:

javascript&colon; new <Your Script Include>().getAssignmentGroups(current);

Make sure to check glide Ajax/client callable on script include form.

 

Mark this as correct/helpful if this solves your query.
 

Thanks

Anand