applying UI Policy only for specific user group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2018 08:49 PM
Hi,
how to write a filter condition based on current user group membership when applying UI policy.
the filter condition is: if current user is member of group X, then do apply some UI policy
I found a code snippet:
if(gs.getUser().isMemberOf(group_X_sys_id)){
//Do something...
}
but how do I put the code into the condition filter box?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2021 08:16 AM
Spelling is important. The above code works - but you have to spell g_scratchpad correctly.
there is a "c" between the "t" and "h".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2018 11:40 PM
Hi
You need to use Client Script in this case.
This would make you work easy.
Call the Script include in client script using GlideAjax.
Do it like this;
Do following changes in your Script Include;
1.)Make it client callable
2.) Your include should start like this,
var SI_name= Class.create();
SI_name.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
func_name:function()
{
//your code
}
}
var ga = new GlideAjax('your_script_include_name');
ga.addParam('sysparm_name','your_SI_function');
ga.getXML(responseFunction);
function responseFunction(response)
{
//and make your changes
}
Mark Correct if it helps.
Warm Regards,
Omkar Mone
www.dxsherpa.com