Remove the Create New button from Incident Task if Incident is assigned to a specific group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2017 08:33 AM
If someone can provide any assistance I would be most appreciative.
I have a customer who wants the "Create New" button removed from the Incident task if the Incident is assigned to a specific group.
If the Incident is not assigned to that group then the Create New button should be there.
Not sure if this needs to be accomplished via a Business Rule or Client Script.
So I see that I would need to update this in two places.
a) Directly remove the Create Inc task button from the Incident if the Incident is assigned to a specific group:
b) Remove the New button directly on the Incident Task.
Thanks,
Karen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 12:01 PM
Karen, a simple addition of "&&" statement to the if statement should fix that issue where you also check if the logged in user == or != to the caller.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 12:09 PM
This is how i put it in the script but it is not working. The highlighted line is where I tried to check to see if the logged in user != to the caller.
It doesn't seem to be working.
if(current.assignment_group=="98947af86f8d250055b74702be3ee413"){ //CSC
if(gs.getUser().isMemberOf("98947af86f8d250055b74702be3ee413")){
if(gs.getUser()!= current.caller_id){
answer=true;
} else{
answer=false;
}
}
} else answer=true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 01:10 PM
HI Karen,
First I am not sure that the last line of your script "else answer=true;" is doing what you expect?
Because as I see you have the two conditions, and this last line gives "true" allowing creation when the first condition fails, that incident assignment group is not the one you specify. Should not it be answer=false; in the last line, and only give "true" if both conditions are true?
These above should apply to the create ACL - if I am right.
Secondly, Harman's addition on the caller check - in my opinion - should be a different, a write ACL, where you restrict incident or incident task editing for callers.
So I would not complicate your initial ACL script with the caller check, especially because the caller issue is related to editing and not creation of incident task which was the first one.
Callers usually have more rights on their own tickets, and these may be originating from some already existing ACLs on task or incident tables.
To restrict caller editing it may not be enough to set up a new ACL as there may be others allowing editing, so it can get complex. You need to first check all the write ACLs on task table and incident tables to see which ones evaluate to true when a caller wants to edit.
Hope this helps,
Best regards,
Andras
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2017 11:19 AM
Hi Karen,
Please try the solution mentioned above,and mark the answer as correct if your query is Resolved. I have tried in my Personal instance and it's working for me.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2021 02:27 AM
How can we do the same for the "Edit " button?
Don't create incident tasks by "XYZ" groups working fine.
Thanks