Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

HI All

basha shaik
Tera Contributor

how to Restrict SC task access a particular user

 

bashashaik_0-1710138878042.png

 

 

 

Thanks

3 REPLIES 3

Harish KM
Kilo Patron
Kilo Patron

Hi @basha shaik do you want to hide assigned to field for a particular user? if yes then use onLoad Client script

var sysid = g_user.getUserID();
if(sysid == 'usersysid')// replace usersysid with user sysid want to hide
{
g_form.setMandatory('assigned_to',false);
g_form.setVisible('assigned_to',false);
}

 

or before insert/update BR script with

 

if(current.assigned_to =='usersysid')

{

gs.addErrorMessage("your not allowed to pick the Task");

current.setAbortAction(true);

}

Regards
Harish

basha shaik
Tera Contributor

I Need not Assign to particular person 

shikhatyagi
Kilo Sage

Hi @basha shaik 

 

Use dictionary override to update reference qualifier condition to restrict one user from assigned_to field selection . Use below query.

 

shikhatyagi_1-1710145822128.png

 

Please mark my answer as Accepted as Solution & hit Helpful button if it helped you.

 

Thanks,

Shikha