'Assign To Me' button in Incident and catalog task and population of assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 03:59 AM
Hello All,
I have a requirement to add 'Assign To Me' button/UI Action in Incident and catalog task. But the button should be available to all, regardless of where the ticket is assigned. For example – I get an email \ call \ Skype asking to look at a ticket assigned to SAP team. I then read the details and I can fix it. So I click “Assign to me” button and pick up the call.
In short, whatever the group the ticket is assigned to, if i click on 'Assign To Me', it should get assigned to My Assignment Group and then to me.
Our system is set like an Incident is assigned to one Group automatically based on the 'IT Service/Business Service' user selection in the ticket and then the support person who is a part of that group can assign to his/her name.
So how to implement the 'Assign To Me' button here? My view is if I click on the 'Assign To Me' button, the ticket should assign to me , if i am part of the group in which the ticket is Assigned. Else if i am not part of that group, a message should come 'You are not part of the group, Please select the correct assignment group' clearing and making the 'Assignment Group' selection field as mandatory (and also it should list the groups which i am part of).
Is that possible? If yes, could you please help with the details/code?
- Labels:
-
Incident Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 04:14 AM
Hi Amith,
Did you check the OOB UI action "Assign to Me". You can make a copy of that and select the table on which you want this UI action to be shown and tweak the server script liek below.
var assignment_group = current.assignment_group.getDisplayValue();
if(gs.getUser().isMemberOf(assignment_group)) {
current.assigned_to = gs.getUserID();
current.update();
} else {
gs.addInfoMessage("You are not part of the assingment group");
}
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 04:35 AM
Hi Asif,
Thanks for replying.
I already checked this UI Action, but it doesn't suite my requirement.
If you read my comment in the question "My view is if I click on the 'Assign To Me' button, the ticket should assign to me , if i am part of the group in which the ticket is Assigned.
Else if i am not part of that group, a message should come 'You are not part of the group, Please select the correct assignment group' clearing and making the 'Assignment Group' selection field as mandatory (and also it should list the groups which i am part of)."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 04:45 AM
Hi Amith,
I already gave you the code. check that once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 05:07 AM
Sorry Asif, I guess you didn't get the proper requirement 🙂 I tried your code but it matches half of my requirement.
The assignment group field should get cleared (if already some other group is present in which the user is not a part of) and make the 'Assignment Group' selection field as mandatory (and also it should list the groups which i am part of)."
Hope now its clear.