How can I add an assignment_group condition to a UI action?

Casey23
Tera Guru

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?

8 REPLIES 8

Saurabh Gupta
Kilo Patron
Kilo Patron

Hi,
Can you share the screenshot where you are writing this code.

 

C

If the provided solution meets your needs, kindly consider marking it as helpful and accepting it as the solution. This helps others who may have similar questions.


Thanks and Regards,

Saurabh Gupta

It's in the condition field of the UI Action:

Casey23_0-1705600009774.png

 

Hi,
Can you please try replacing current.assignment_group to current.getValue('assignment_group').

 


Thanks and Regards,

Saurabh Gupta

Wouldn't that just return the value of any assignment group in the field? I'm attempting to look for a specific assignment group. Or are you saying it should look like this: current.getValue('assignment_group')=='sys_id_of_the_group_here'