
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017 04:45 AM
I want to remove the UI Action Button "Create Inc Task" from anyone IF (see the conditions below)
a. The ticket is assigned to a specific assignment group
b. And you are not a member of that group
What is the best way to accomplish this?
I know that you can do a hide/show via a UI Policy but I am not sure what to put in the script.
What is the risk (if any) of doing the UI Policy?
Is there a better way to accomplish this? If so, you could please provide a solution?
Thanks,
Karen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017 05:43 AM
Yes, since this condition is a bit complex, the only way I can think of is creating a script include and calling the script include in UI Action condition. I am giving you a tried and tested script, let me know if it works:
UI Condition: new showCreateTask().canView(current,gs)
Script Include: Name: showCreateTask
var showCreateTask = Class.create();
showCreateTask.prototype = {
initialize: function() {
},
canView : function(current,gs)
{
if(current.assignment_group == 'sys_id of your group' && gs.getUser().isMemberOf(current.assignment_group))
return true;
if(current.assignment_group != 'sys_id of your group')
return true;
else
return false;
},
type: 'showCreateTask'
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017 04:55 AM
Hi Karen,
Can you please clear the conditions of the requirement. If I understood it correctly it is like "Hide the UI Action for particular group suppose ABC only if I am not the member of ABC group but if lets suppose xyz is member of ABC group then button should be visible to xyz".
Please let me know if my understanding is correct.
Regards,
Anjali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017 04:59 AM
Good morning Anjali - So you are partially correct.
The scenario is the button should be visible if the ticket is assigned to group ABC and you are a member of group ABC
If the ticket is assigned to group ABC and you are NOT a member of group ABC then it should not be visible.
Hope that helps.
Thanks, for replying so quickly.
Karen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017 04:56 AM
Hi,
In UI Action you need to use condition for that group.
for more detail see following.
http://wiki.servicenow.com/index.php?title=UI_Actions#Controlling_Visibility_with_Conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2017 04:58 AM
Hi Karen,
In ui action condition itself you can give these condition !((gs.getUser().isMemberOf("your Group name"))
It will work.
Thanks,
Abhishek