Only specific group can close incident based on business service

Alex Saager1
Tera Contributor

Hello,

 

I have a requirement for only a specific assignment group to be able to close an incident based on conditions such as a business service, what's the best way to achieve this?

 

Many thanks,

 

Alex

6 REPLIES 6

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Alex Saager1 ,

 

You can create a before business rule with condition as state changes to closed (please use which state u have configured in your instance) and try below code

 

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

    // Check conditions (e.g., business service) for closure

    if (current.u_business_service == 'YOUR_BUSINESS_SERVICE') {

        // Conditions met, allow closure

    } else {

        // Conditions not met, prevent closure and show a message

        current.setAbortAction(true);

        gs.addErrorMessage("Incident cannot be closed due to invalid business service.");

    }

})(current, p

revious);

 

Thanks,

Danish

 

Hi Danish, 

 

Thank you for your reply that's also helpful, I was think more along the lines of for example only the security team can close incidents if the security business service is selected.

 

Many thanks,

Alex 

Hi @Alex Saager1 ,

 

So wht i have understood is if security business service is selected than we need to validate the person who is closing the ticket is from security group or not correct?

 

If yes then in the service table from where the service is selected will the same group be der under support group for that service?

 

As the person group who is closing the ticket & the support group of the business service should be same.

 

Let me know if my understanding is correct then will update the code n provide u.

 

Thanks,

Danish

 

Hi,

 

That's correct on both parts

 

Many thanks,

Alex