
- 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 05:04 AM
Hi Karen,
I have tested it in my instance it is working fine.
!((gs.getUser().isMemberOf("your Group name")))
Thanks,
Abhishek
Please mark this response as correct and helpful via your post link (Hide a UI Action Button for tickets assigned to a specific group ) to help others with the same question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 04:58 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2017 05:22 AM
Thank you so much. This is partially working.
However I see that it seemed to have removed the Create Inc Task button for all incidents for other fulfillers that is not assigned to that assignment group
Meaning - yes it did Remove the Create Inc Task button for any ticket that is assigned to that group if you are not a member of that group, but I wanted to confirm to make sure the button was still there for a fulfiller for other tickets not assigned to that group and it seems to be missing from all Incidents.
I impersonated another fulfiller and went to an Incident that was not assigned to that group and the Create Inc Task was not there.
So there are some other conditions on the UI Action.
- 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 06:09 AM
Thank you sooooooooooo much. It appears to be working perfectly.
I emailed my customer so they can test.
As soon as they test, if they find no issues. I will most definitely mark this complete.
Stay tuned.
Karen