Check conflicts on change requests
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 02:19 PM
Is there a way to have "check conflicts" automatically run upon submission of a change request?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 10:14 PM
Hi Maria,
Just call 'Check Conflicts' method from 'Submit' UI Action of Change Request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2014 06:54 AM
Thanks. I will give that a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2015 04:48 AM
I disabled the UI Action, and created a Business Rule running before insert / update on the Change Request table.
The script was a slightly modified version of the server-side code you find in the Check Conflicts UI Action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2015 06:58 AM
In case it helps, here's the Business Rule I used to Check Conflicts.
Name: Check Conflicts
Table: Change Request
Advanced: yes
When: before
Insert: yes
Update: yes
Filter conditions:
Planned Start Date is not empty AND
Planned End Date is not empty AND
Configuration Item is not empty
And this goes in the script section.
function onBefore(current, previous)
{
// Slimmed down version of OOTB Check Conflicts UI Action.
// It's better to automatically check for conflicts on saving,
// rather than forcing users to click a UI Action link.
suppressMaintenanceScheduleMessages = true;
var conflictDetector = new ChangeCheckConflicts(current);
var conflictResults = conflictDetector.check();
current.conflict_status = 'No Conflict';
var msg = '';
if (conflictResults < 0) {
// Shouldn't happen, as CI is a condition of the rule running
msg = gs.getMessage('Configuration Item needed for conflict analysis');
}
else if (conflictResults == 0) {
// Msg commented out. Assume no news is good news!
//msg = gs.getMessage('There are <FONT COLOR="green">NO CONFLICTS</FONT>');
}
else {
msg = gs.getMessage('There are <FONT COLOR="tomato">Schedule Conflicts</FONT> - see "Conflicts" tab at bottom of ticket for details.');
current.conflict_status = 'Conflict';
}
if (msg != '') {
gs.addInfoMessage(msg);
action.setRedirectURL(current);
}
}