How to make a field visible in sc_task table for a particular assignment group?

Amith P
Kilo Contributor

Hello,

I have a requirement to make one field visible for a specific assignment group in catalog task. Say for example, a catalog task has been created and assigned to one particular assignment group 'X' via workflow/catalog group mapping, while raising a request using a service catalog. And the 'X' group member assign that particular task to another assignment group 'Y'. And a field (a string with drop down values) has to be visible only for the group 'Y' and not for 'X', in that catalog task.

I tried in UI policy, but the field is getting visible in both the groups. Tried ACL also, but not working. 

Please let me know if you have any work around.

Thanks,

Amith.

1 ACCEPTED SOLUTION

Kotaiah
Kilo Guru

Hi Amith,

 

You can achieve the above requirement using ACL's. You have to create two acls on task table for that particular field.

One for read access & other is for write access.

You have to use this below script in read acl:

answer = false;

if(gs.getUser().isMemberOf(current.assignment_group)) {
answer = true;
}


You have to use this below script in write acl:

answer = false;

if (gs.getUser().isMemberOf(current.assignment_group)) {
answer = true;
}

Regards,

Koptaiah Sadari

View solution in original post

7 REPLIES 7

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

the following thread will give you the idea of how to achevie your requirement:

https://community.servicenow.com/community?id=community_question&sys_id=f7a1cb69db98dbc01dcaf3231f96...

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

arielgritti
Mega Sage

Hello

You can try with a onChange client script in the assignment_group field to show/hide the field.

 

Please, mark correct, useful or bookmark if I helped you

Thanks

Ariel

Shrutika Surwad
Kilo Guru

hello,

go to client script from filter navigator

then select type onChange from type 

select field as assignment_group

 

write code

setMandatory('field_name');

setReadOnly('field_name');

 

please mark helpful/correct !

 

Hi,

The field will be there in task right. Even if we create the client script, it will only make the field as mandatory/read only.

How to make the field visible only to that particular group and not for the other groups. We tried ACL and also not working.