- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Need guidance on implementing a ServiceNow UI Action button on the Incident form with conditional visibility. The button should be visible only when the Incident is in an Active state, when the “Assigned To” field is populated, and only if the assigned user belongs to the same Assignment Group (for example, Hardware Group).
Whenever I am trying to add condition, I am not seeing the button
current.active == true &&
!gs.nil(current.assigned_to) &&
gs.getUser().isMemberOf('hardware')
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi AbW, I was testing the condition you used in your case and when I found the incident that matches your condition and I was member of that group, it works for me:
Could you please check if your setting of UI action looks similar to mine?
The condition at the bottom of the setting is copy-paste of your condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @AbW
try this:
- Name: Give your UI Action a name (like Assign to Me)
- Table: Incident
- Show insert: Checked
- Show update: Checked
- Client: Checked
- Condition: current.active == true && !current.assigned_to.nil() && gs.getUser().isMemberOf(current.assignment_group.getDisplayValue())
- Script:
function customActionFunction()
{
// Add your business logic here
gs.addInfoMessage("Action processed successfully.");
current.update();
}
if (typeof window == 'undefined')
{
customActionFunction();
}
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti