Incident state should be resolved if the Problem state is resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 10:53 AM
Hi Everyone,
My requirement was to make the assign to field not mandatory if the incident state is on hold and the on hold reason is "Awaiting Problem", I create a UI Policy and this requirement is working fine. But once I add the incident which is in on hold state to the Problem and change the Problem state to resolve the Incident state is still in On-hold. But if the "assign to" field is not empty then the incident getting resolved with the problem.
I created a business rule it is only working if the assigned to state is not empty. But the incident should be closed once the problem is closed if the assign to is filled or not doesn't matter.
I checked data policies, other BR conflicting or not but nothing found.
Could you please help me on this.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 11:31 AM
Please share your script.
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 11:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 11:40 AM
Your business rule has to be on the problem with the condition when the problem state changes to resolved. You need to reverse your logic in the script too.
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 08:55 PM
Try with the below updated Business Rule :
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var incGr = new GlideRecord('incident');
incGr.addQuery('problem',current.sys_id);
incGr.query();
while(incGr.next()){
incGr.state = '6';
incGr.close_code = 'Resolved by problem';
incGr.close_notes = current.close_notes;
incGr.update();
}
})(current, previous);
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.