- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2020 10:47 PM
I have a requirement to create a UI Action (button) on incident that should assign the current login user to assigned_to field.
Note: assigned to should be a member of assignment group then only it will accept the value. otherwise to create a popup to say you are not a member of this group
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2020 02:14 AM
glad it helped,
kindly mark my answer as correct and close this thread. so it will appear into solved queue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2020 12:05 AM
I tried your code given above.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2020 12:08 AM
is it still not working ?
can you paste screenshot of your UI Action and script include ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2020 11:13 PM
Hi Ankit,
I would recommend below approach
1) Show the UI action only when the logged in user is member of assignment group of the record
2) It is not good user experience for users to show them the UI action and then when they click they get to
know they cannot assign the incident to themselves as they are not member
1) Create UI Action which is server side
Name: Assign to Me
Condition: gs.getUser().isMemberOf(current.assignment_group)
Script:
current.assigned_to = gs.getUserID();
current.update();
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2021 11:21 PM
Hi
can you please help me in this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2020 12:13 AM
Hi Ankit,
Did you get a chance to read my comment and implement that considering the approach?
Let me know if that helped or stuck anywhere.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader