UI Action - Condition - is member of parent assignment group

Tim129
Tera Contributor

Greetings,

I have a parent task and sub task custom application setup. within my sub task, I have a number of UI Actions (buttons) that will become available throughout the process of the task and to specific individuals or groups involved with the task. All are currently working properly but I recently had a change requested for one of them. The UI Action is called Close and the current condition states that the button becomes available when the state is complete for review and the person accessing the subtask is either the individual who opened it or a member of the task management group.

current.state == 1 && (gs.getUserID() == current.getValue("opened_by") || gs.getUser().isMemberOf('Task Management')

The customer would like to have anyone within the same group that the opened_by individual resides in to be able to see the button.

for the Parent task the process is that the assignment group is selected and then the parent task lead is chosen from that group. That parent task lead will then create and manage all of the sub tasks that are created within that parent task.

I currently have a reference to the parent task within the sub task form and a parent task info tab which has a number of key fields from the parent task. One of those fields is the assignment_group. I tried to adjust my condition to do a reference to that assignment group field but is not working.

current.state == 1 && (gs.getUser().isMemberOf(current.getValue("parent_task.assignment_group")) || gs.getUser().isMemberOf('Task Management')

Any Ideas?? Thanks!

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

try

current.state == 1 && (gs.getUser().isMemberOf(current.parent_task.assignment_group.toString()) || gs.getUser().isMemberOf('Task Management'))

View solution in original post

4 REPLIES 4

Mike Patel
Tera Sage

try

current.state == 1 && (gs.getUser().isMemberOf(current.parent_task.assignment_group.toString()) || gs.getUser().isMemberOf('Task Management'))

Mike,

Thanks for the quick response adding the .toString() worked like a charm.

Respectfully,

Tim

Great!

Please mark answer correct to close out the thread!

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Tim,

Replace condition with current.state == 1 && (gs.getUser().isMemberOf(current.parent_task.assignment_group.getDisplayValue()) || gs.getUser().isMemberOf('Task Management')