- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:34 AM
I'm trying to hide the Assign to Me UI Action in sn_customerservice to where it will only show after an Assignment Group is selected and if the current user is a member of the Group. I have tried using gs.getUser().isMemberOf(current.assignment_group) as the condition but it is not working. I can use an OnChange client script to do this but it does not work if the Assignment Group field is empty. Does anyone know of another UI Action condition that would solve this?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:40 AM
isMemberOf() uses a display name, so try this instead...
gs.getUser().isMemberOf(current.assignment_group.getDisplayValue())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:40 AM
isMemberOf() uses a display name, so try this instead...
gs.getUser().isMemberOf(current.assignment_group.getDisplayValue())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 11:51 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 12:33 PM
Best practice is to use getDisplayValue() rather than dot-walk to the name field. While they are the same value most of the time, it isn't absolutely certain in every case.
See section 5.5 here: http://wiki.servicenow.com/index.php?title=Coding_Best_Practices#Use_getDisplayValue.28.29_Effective...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2017 02:41 AM
Hi Chuck, how would i add the condition to only show if the assigned to is not me or empty
I have tried this... but not working. !current.assigned_to == gs.getUserID();