Restrict user to resolve the incident

nani1
Tera Contributor

Hi Team,

I'm Trying to stop user resolving the incident which contains priority is P1/P2. its working but not meeting our Test Cases:

1)if priority is p1/p2  then it allow only "major incident management team" to resolve the incident. 

2)  Allow other users to update the incident or assignee to "Major incident management team to resolve the incident

currently below Before BR not allowing any user to raise a p1/p2  incidents or update anything when priority is p1/p2. 

let me know if any changes required in the BR or its a correct way to write the Before BR  for this request.

 

1)When to Run

nani1_0-1710850877953.png

 

2)Script:

nani1_1-1710850877993.png

 

let me if any error in my code. only "Major incident management" group allow to resolve the priory P1/P2 incidents

1 ACCEPTED SOLUTION

Hi @nani1 

 

Can you replace yours with the following code and try-

 

 

if (current.assignment_group != 'Incident Management Group') {
            if (current.state == '6') { 
                current.state = previous.state; // Rollback state change
                current.setAbortAction(true);
                current.addErrorMessage("Only the 'Incident Management Group' can resolve incidents with priority P1 or P2.");
            }
        }

 

Please mark my answer helpful and correct.

 

Regards,

Amit

View solution in original post

18 REPLIES 18

@nani1 ,

 

Using on change client script , check the incident is p1 or p2 and assignment group is ncident Management Group, check this condition and avoid form submit and throw an error message.

Hi @nani1 

 

Can you replace yours with the following code and try-

 

 

if (current.assignment_group != 'Incident Management Group') {
            if (current.state == '6') { 
                current.state = previous.state; // Rollback state change
                current.setAbortAction(true);
                current.addErrorMessage("Only the 'Incident Management Group' can resolve incidents with priority P1 or P2.");
            }
        }

 

Please mark my answer helpful and correct.

 

Regards,

Amit

Hi,

I updated the below script, its not allowing "Incident Management Team" too resolve the incidnet

if (current.assignment_group != 'Incident Management Group') {
            if (current.state == '6') { 
                current.state = previous.state; // Rollback state change
                current.setAbortAction(true);
                current.addErrorMessage("Only the 'Incident Management Group' can resolve incidents with priority P1 or P2.");
            }
        }

Hi @nani1 

 

Can you pass the sys_id of Incident Management Group and check?

 

Alternatively, you can do it without scripting as well. Refer below ss-

 

1.  You can use Incident Management Group in the filter. I have used Support Level for testing.

AmitPandey_0-1710864442199.png

2. 

AmitPandey_1-1710864491241.png

Please mark my answer helpful and correct.

 

Regards,

Amit

 

Hi Amith,

Thank for the update, i tried both the cases it's not working anyway.

I think we need to update in the existing script 

if (current.assignment_group != 'SYS_ID OF GROUP') {
            if (current.state == '6') { 
                current.state = previous.state; // Rollback state change
                current.setAbortAction(true);
                current.addErrorMessage("Only the 'Incident Management Group' can resolve incidents with priority P1 or P2.");
            }
        }