- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 10:04 PM
So, I am implementing a doer-checker process for Change Management wherein the person who is the "Doer" of the change request cannot be the "Checker" of the change request.
I created two automated change tasks (after the change request moves to Implement state) one will be the "Doer" task while the other one will be the "Checker" task. I want to make sure that the user in the assigned to of "Doer" task does not appear on the assigned to reference list of the "Checker" task.
How can I achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 09:45 PM
You can define a function in a script include to build your own custom query for the Assigned to field in the Change Task table.
Sample below we get the Assignee Sys ID from the Does task, then in the Checker task we will filter that User out.
#Script Include
var CLChangeRequestUtil = Class.create();
CLChangeRequestUtil.prototype = {
initialize: function() {},
getRefQualChangeTask: function(change_task) {
var query = 'roles=itil^ORroles=sn_change_write'; //OOTB Default Query in Change Task
var assigneeDoes = this._getDoesAssignee(change_task);
if (!gs.nil(assigneeDoes)) {
query += '^sys_id!=' + assigneeDoes;
}
return query;
},
_getDoesAssignee: function(change_task) {
var assigneeDoes = '';
var grChangeTask = new GlideRecord('change_task');
grChangeTask.addQuery('change_request', change_task.getValue('change_request'));
grChangeTask.addQuery('task_type', 'Does'); //replace your task type Does
grChangeTask.query();
if (grChangeTask.next()) {
assigneeDoes = grChangeTask.getValue('assigned_to');
}
return assigneeDoes;
},
type: 'CLChangeRequestUtil'
};
#Dictionary Override
javascript: new CLChangeRequestUtil().getRefQualChangeTask(current);
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 10:15 PM
Hi,
You can write an advance reference qualifier.
Reference qualifiers (servicenow.com)
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 04:04 AM
Hi, Yes, the Reference qualifier is one route. Another Route - When you create a 2 task you can define the simple UI policy or Client script and make it Assignment group field a 'Read Only' field. When you apply the solution - It should apply to your mentioned scenario and it should not affect globally.
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 09:45 PM
You can define a function in a script include to build your own custom query for the Assigned to field in the Change Task table.
Sample below we get the Assignee Sys ID from the Does task, then in the Checker task we will filter that User out.
#Script Include
var CLChangeRequestUtil = Class.create();
CLChangeRequestUtil.prototype = {
initialize: function() {},
getRefQualChangeTask: function(change_task) {
var query = 'roles=itil^ORroles=sn_change_write'; //OOTB Default Query in Change Task
var assigneeDoes = this._getDoesAssignee(change_task);
if (!gs.nil(assigneeDoes)) {
query += '^sys_id!=' + assigneeDoes;
}
return query;
},
_getDoesAssignee: function(change_task) {
var assigneeDoes = '';
var grChangeTask = new GlideRecord('change_task');
grChangeTask.addQuery('change_request', change_task.getValue('change_request'));
grChangeTask.addQuery('task_type', 'Does'); //replace your task type Does
grChangeTask.query();
if (grChangeTask.next()) {
assigneeDoes = grChangeTask.getValue('assigned_to');
}
return assigneeDoes;
},
type: 'CLChangeRequestUtil'
};
#Dictionary Override
javascript: new CLChangeRequestUtil().getRefQualChangeTask(current);
Cheers,
Tai Vu