- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 02:47 AM
‘Assign to Me’ button shows up on all New tickets right now. Clicking on it simply assigns the Incident to the current user irrespective of the Assignment group selected on the ticket
We should either -
i. Not show this button if the current user is not a part of the ticket’s assignment group.
ii. Give an error message letting the user know that the ticket cannot be assigned to them as they’re not a part of the group.
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 03:17 AM
Hello,
In the UI action "Assign to me", just add the below condition then ti will only show if the user is a part of the group:-
gs.getUser().isMemberOf(current.assignment_group.toString())
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 10:25 AM
Hello,
I am glad you you got the final output. You can mark any of my answer correct/helpful based on Impact
Also I answered another of your query as well in the below thread can you mark my answer as correct on this thread as well:-
https://community.servicenow.com/community?id=community_question&sys_id=423edf5bdb910550dd886c8e1396190a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 10:31 AM
can you take a look into this thread as well please - https://community.servicenow.com/community?id=community_question&sys_id=6034fd1fdb158d1007ab82630596193f

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 03:59 AM
Hi Rahul,
Before edit the Assign to me button you have to select the correct application then you will be able to save the condition.
Thanks
Sanjay Bagri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 04:03 AM
The condition is working fine but what I want is to Give an error message like letting the user know that the ticket cannot be assigned to them as they’re not a part of the group.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 04:17 AM
Use this below code:
Unchecked Client Checkbox and try with below code:
if(gs.getUser().isMemberOf(current.assignment_group))
{
current.assigned_to=gs.getUserID();
}
else
{
gs.addInfoMessage('Looged-in user is not a member of the selected Assignment Group');
gs.addInfoMessage('select in assign to');
}
action.setRedirectURL(current);
current.update();