Service catalog task

harver31
Tera Contributor

 I would like to have right to create a new catalog task.  This is complete when only the service desk member is able to create new task.

How to achieve this scenario?

10 REPLIES 10

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @harver31 

 

Here is list:

 

AtulyaLNG_0-1699958990322.png

 

 

Please have a look and get the access. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hello Atulya, For this scenario 
- Only ITIL users and service desk members can create catalog tasks with the help of the new button. No other users will have access to the new button.
- We have to restrict other users to create new catalog task through catalog task list & through related list section.



Hi @harver31 

 

- Only ITIL users and service desk members can create catalog tasks with the help of the new button. No other users will have access to the new button.

Atul: Practically saying, manual creation of Catalog task is not recommended. It should be fully auto created. In this case you need to write / update script on New Button for ITIL and SD members ( They also have ITIL role) I assume. 
- We have to restrict other users to create new catalog task through catalog task list & through related list section.

Atul: Update the New UI Button on RITM level. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Yeah, Exactly I have to create New UI Button to achieve this scenario. I need script to achieve this.
For condition I am using this : 

gs.hasRole('itil') && gs.getUser().isMemberOf('Service Desk')


Script I am using : 

(function executeUIAction(current, previous /*null when async*/ ) {
    // Check if the current user has the 'itil' or 'service_desk' role

    var userHasITILRole = gs.getUser().hasRole('itil');
    var userHasServiceDeskMember = gs.getUser().isMemberOf('Service Desk');

    // Display the UI Action only if the user has either 'itil' or 'service_desk' role

    if (userHasITILRole && userHasServiceDeskMember) {
        return true; // Display the button
    } else {
        return false; // Hide the button
    }
})(current, previous);

with this I am not able to get desired result.