Only specific group can close incident based on business service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 06:04 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 08:18 AM
Hi @Alex Saager1 ,
(function executeRule(current, previous /*null when async*/) {
// Check conditions (e.g., business service) for closure
if (current.u_business_service.support_group == current.assignment_group && gs.getUser().isMemberOf(current.assignment_group.toString())) {
// 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, previous);
Can u try this n check please.
Thanks,
Danish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 03:33 PM - edited 11-01-2023 03:35 PM
I would create client script on Incident table to make state field read only except specific assignment group and business service. The sample code is below
var grp = g_form.getValue('assignment_group') ;
var srvc = g_form.getValue('business_service') ;
// make sure to use correct field names
if( grp == 'sys_id_of_assignment_group' && srvc =='the_value_of_business_service') {
g_form.setReadOnly('state',false) ;
} else
g_form.setReadOnly('state',true) ;