- 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:18 AM
Hello Ankit
I have Acknowledged from your statement,these are some suggestions from my side:-
1)First You have to check whether the user is member of that group or not?
Please Mark Correct and Helpful
Thanks and Regards
Gaurav Shirsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2020 02:08 AM
correct that is my requirement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2020 10:18 AM
Hi Ankit,
The comment of Ankur has a point that make the UI action only visible when the logged in user is a member of logged in group but in the scenario where the logged in user changes the assignment group the UI action will not be available for that scenario condition gets executed while loading of the form.
You can use the below script to assign the Current logged in user the current ticket and display a error message if the logged in user is not a assignment group member. Also, if user tries to assign the ticket with empty assignment group below script will throw an error message to enter an assignment group..
if (!current.assignment_group.nil()) {
if (gs.getUser().isMemberOf(current.assignment_group)) {
current.assigned_to = gs.getUserID();
current.update();
} else {
gs.addErrorMessage("You are not a member of assignment group");
}
} else {
gs.addErrorMessage("Please enter a assignment group");
}
Note: With the above approach the UI action will be always visible. If you want to get the UI action visible based on the assignment group validation then you could go with the Ankur suggestion.
Kindly mark my answer as Correct and Helpful based on the Impact.
Regards,
Alok

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2020 10:26 AM
any update on this thread?
if my answer helped you, kindly mark it as correct and close this thread .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2020 02:06 AM
i have made some changes now its working fine thanks your code help me alot.