How can I add an assignment_group condition to a UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 09:36 AM - edited 01-18-2024 09:37 AM
Hello all. I'm having some issues updating the condition on a UI action and am looking for some guidance. We have a UI action that is currently working. The condition for that UI action is:
(current.u_work_order_number.nil())&&(gs.getUser().hasRole('itil'))
I'd like to add to the condition to ensure that the assignment_group field on the record is equal to a particular assignment group. To do that, I've updated the condition to look like this:
(current.u_work_order_number.nil())&&(gs.getUser().hasRole('itil'))&&(current.assignment_group == 'sys_id_of_the_group_here')
After adding the assignment group piece to the condition, I then added a template to an incident and I see an error underneath the template field on our incident form:
"onChange script error: TypeError: Cannot read properties of undefined (reading 'show') function () { [native code] }"
Removing the assignment group piece of the condition ensures that the error goes away. In the Service Operations Workspace, nothing happens after adding the template.
Does anyone have an idea of why this condition isn't working or how I can fix it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 09:54 AM
Hi @Casey23
yes like below
current.getValue('assignment_group')=='sys_id_of_the_group_here'
Also did you check if assignment_group field available on your table.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 09:59 AM
I get the same result after making the change. Yes, the field exists. The UI action is for incidents.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 10:02 AM
But error looks like from onchange client script.
Can you please the one.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 12:09 PM
That's confusing to me as well. The error didn't occur until I modified the UI action. And if I look at all onChange scripts that reference the u_template field (the one with the error) there are only two onChange client scripts. If I disable both of them and then apply a template (which should trigger the UI Action I'm asking about) the error then appears.