How to show New button to only specific group in catalog task

Samiksha2
Mega Sage

Hi,

 

I have a requirement to show New button only to specific groups in the catalog task.

How to achieve that?

Samiksha2_0-1691759553584.png

 

Thanks,

Samiksha

2 ACCEPTED SOLUTIONS

Hi @Samiksha2,

This article isn't going to help you. The edit button is completely different.
The New button is a global button, for multiple tables. You will have to create a 'create' ACL on the sc_task table in order to control the visibility of the button and leave the button itself OOTB.

Is there only 1 group which should be able to create sc_tasks, or is it dynamic?

If it's 1 group, you could just use in the ACL Script:

 

if((gs.getUser().isMemberOf('<<group sys_id>>')))   {
  answer = true;
}
else{
answer = false;
}

 

 

View solution in original post

Not applicable

Hello @Samiksha2 

 

If it is working, As per new community rules you can mark multiple solution as Accept.

 

Pls mark my solution as Accept.

 

Regards,

Samaksh

View solution in original post

18 REPLIES 18

Hi @Peter Bodelier ,

I checked one community post, the solution was to add script.

https://www.servicenow.com/community/developer-forum/edit-button-visible-only-to-specific-group/m-p/...

I am trying to do same but for new it is not working

Hi @Samiksha2,

This article isn't going to help you. The edit button is completely different.
The New button is a global button, for multiple tables. You will have to create a 'create' ACL on the sc_task table in order to control the visibility of the button and leave the button itself OOTB.

Is there only 1 group which should be able to create sc_tasks, or is it dynamic?

If it's 1 group, you could just use in the ACL Script:

 

if((gs.getUser().isMemberOf('<<group sys_id>>')))   {
  answer = true;
}
else{
answer = false;
}

 

 

Hi @Peter Bodelier ,

Yes only one group.

Allright, let me know if you have issues with creating the ACL.

Hi @Peter Bodelier,

I tried to create ACL but its not working.

Samiksha2_0-1692683143685.pngSamiksha2_1-1692683162798.pngSamiksha2_2-1692683268057.png