How to revoke access for users, Resolver Teams and Service Desk agents to downgrade an incident

Priyanka145
Tera Contributor

Hi All,

 

I am having a requirement to revoke access for users, Resolver Teams and Service Desk agents to downgrade an incident. They should not have access to downgrade the priority from high priorities to lower priorities.

The access should be there for Major Incident Management team alone and to Admins.

Please guide me how can this be done.

1 ACCEPTED SOLUTION

Hi Priyanka,

 

Please find the condition below -

It's a before update BR

HarshalAditya_0-1676634942864.png

 

(function executeRule(current, previous /*null when async*/ ) {

    if (!gs.getUser().isMemberOf("Major Incident Management") || !gs.getUser().hasRole('admin')) {
        gs.addErrorMessage("Please note you are not allowed to downgrade the priority");
        current.setAbortAction(true);
    } else if (gs.getUser().isMemberOf("ServiceDesk Agent")) {
        gs.addErrorMessage("Please note you are not allowed to downgrade the priority");
        current.setAbortAction(true);
    }
})(current, previous);
 
This is a rough example please make necessary updates.
 

If my answer has helped with your question, please mark it as helpful and give it a thumbs up!

Regards,
Harshal

 

View solution in original post

3 REPLIES 3

Harshal Aditya
Mega Sage
Mega Sage

Hi Priyanka,

 

There are multiple ways to achieve the same -

1. Client script - You would need to write an on-change client script on impact and urgency . You would need to hide the options on impact and urgency.

2. Business Rule - In the before business rule you would need to do a setAbortAction if priority is downgraded.

3. ACL - You would need to have write ACL on impact and urgency field. But note that ACL will render the field Read-Only so you will not be able to upgrade the incident.

 

If my answer has helped with your question, please mark it as helpful and give it a thumbs up!

Regards,
Harshal

Hi @Harshal Aditya 

thanks for the options.

Could you please let me know how I can write it via BR. What conditions I can put.

Hi Priyanka,

 

Please find the condition below -

It's a before update BR

HarshalAditya_0-1676634942864.png

 

(function executeRule(current, previous /*null when async*/ ) {

    if (!gs.getUser().isMemberOf("Major Incident Management") || !gs.getUser().hasRole('admin')) {
        gs.addErrorMessage("Please note you are not allowed to downgrade the priority");
        current.setAbortAction(true);
    } else if (gs.getUser().isMemberOf("ServiceDesk Agent")) {
        gs.addErrorMessage("Please note you are not allowed to downgrade the priority");
        current.setAbortAction(true);
    }
})(current, previous);
 
This is a rough example please make necessary updates.
 

If my answer has helped with your question, please mark it as helpful and give it a thumbs up!

Regards,
Harshal