UI Policy or Client Script not working on SOW , though working in Global Scope.

ankitaankit
Tera Contributor
Hello Team,
Please help with below requirement,
Now I am having a Summary field on Incident form  which visible only when Priority is P1(written as part of UI Policy) and also  is having  ACL
 as :Allow write for Summary in Incident, for users with role major_incident_manager, and if the below ACL script returns true.
which is as below:
 
 if (current.incident_state == '7') {
    answer = false;
} else {
if(gs.getUser().isMemberOf(gs.getProperty('group.sys_id.WW-XX-MIM-GOM'))  ){
answer = true;
}
else{
answer = false;
}
    
}
 
My requirement is to show the same field "Summary" on SOW and all these conditions should work there too,
Though I added the field from  form Layout in particular view, and wrote a Client script under Service Operation Core scope to attain the same functionality 
but the field becomes visible in all other Priority, so my client script is not working.
 
Please help how can I attain it in SOW.
 
Thanks.
1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@ankitaankit 

ACL will work in both native and workspace

Are you sure your client script or UI policy is running in workspace view as well?

Client Script & UI Policies -> Ensure global checkbox is true so that it runs on all views

Also make sure no other client script or UI policy is doing the reverse in workspace.

AnkurBawiskar_0-1753181811544.png

AnkurBawiskar_1-1753181837358.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@ankitaankit 

ACL will work in both native and workspace

Are you sure your client script or UI policy is running in workspace view as well?

Client Script & UI Policies -> Ensure global checkbox is true so that it runs on all views

Also make sure no other client script or UI policy is doing the reverse in workspace.

AnkurBawiskar_0-1753181811544.png

AnkurBawiskar_1-1753181837358.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Shraddha Kadam
Mega Sage

Hello @ankitaankit ,

 

Try to uncheck the Global checkbox from the UI Policy and select the view "SOW" and see if it is working.

ShraddhaKadam_1-1753182213817.png

 

ShraddhaKadam_0-1753182167207.png

 

If my response was helpful, please mark it as correct and helpful.
Thank you.