- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Everyone,
The assign to me ui action on service operation workspace doesn't shows up if it is assigned to someone else of the group i am already part of.
I want this should show if it is assgned to one of my group and not assigned to me then i want to show the button.
@Ankur Bawiskar what all changes i should do also the OOb script include and canassignedtome() button doesn't have the script to hide why its getting hided?
Regards,
Debasis
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Debasis Pati
Yes, this script will break the "Assign to Me" functionality for all other tables
The button will disappear entirely for every module except Incident.
Use this script as it uses your custom logic for Incident, but preserves the Out-of-the-Box (OOB) strict logic for everything else.
canAssignToMe: function(current) {
var currentTable = current.getTableName();
var arrayUtil = new global.ArrayUtil();
var allowedTables = ["problem", "incident", "change_request", "problem_task"];
if (!arrayUtil.contains(allowedTables, currentTable))
return false;
if (!current.active && !current.isNewRecord())
return false;
if (!this._checkRolesForAssignment(currentTable))
return false;
if (!current.assigned_to.canWrite())
return false;
if (currentTable == 'incident') {
// Hide if already assigned to ME
if (current.assigned_to == gs.getUserID())
return false;
return current.assignment_group.nil() || gs.getUser().isMemberOf(current.assignment_group.toString());
}
if (!current.assigned_to.nil())
return false;
return current.assignment_group.nil() || gs.getUser().isMemberOf(current.assignment_group.toString());
},
Happy to help! If this resolved your issue, kindly mark it as the correct answer ✅ and Helpful and close the thread 🔒 so others can benefit too.
Warm Regards,
Deepak Sharma
Community Rising Star 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Hello @Ankur Bawiskar & @Deepak Shaerma ,
Updated the script include function to this.
so the script function will explicitly act different for as it was earlier and will work as we need for incident table.
correct me if i have done any mistake.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
looks fine to me
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Hello @Ankur Bawiskar & @Deepak Shaerma ,
Updated the script include function to this.
so the script function will explicitly act different for as it was earlier and will work as we need for incident table.
correct me if i have done any mistake.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
looks fine to me
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
