- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 05:35 AM
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
2)Script:
let me if any error in my code. only "Major incident management" group allow to resolve the priory P1/P2 incidents
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 06:21 AM - edited 03-19-2024 06:22 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 06:13 AM
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 06:21 AM - edited 03-19-2024 06:22 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 07:19 AM
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."); } }
o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 09:08 AM - edited 03-19-2024 09:09 AM
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.
2.
Please mark my answer helpful and correct.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 12:26 PM
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."); } }