Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

restrict the task state on assigned to field

vinnus
Tera Contributor

we are making task state editable on below conditions only on top of we need add assigned to is current logged in user then only can edit the state field 

vinnus_0-1733145354660.png

tried wit run script  in true section not working and assigned to dynamic (me) as well

if (current.assigned_to == gs.getUserID()) {
    g_form.setReadOnly('state', false); // Make editable
} else {
    g_form.setReadOnly('state', true); // Make read-only
}
1 REPLY 1

vinnus
Tera Contributor

action:

vinnus_0-1733145516135.png