Change Task cannot be assigned to the same person as the previous Catalog Task.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 01:48 AM
What do i wrong?
I made a business rule for a change so thats not posible the same user do both task.
(function executeRule(current, previous /*null when async*/) {
var tsk = new GlideRecord('change_task');
tsk.addQuery('Parent', '==', current.Parent);
tsk.addQuery('sys_id', '!=', current.sys_id);
tsk.query();
if (tsk.next()) {
if (tsk.assigned_to == current.assigned_to) {
gs.addErrorMessage('Change Task cannot be assigned to the same person as the previous Catalog Task.');
current.setAbortAction(true);
}
}
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 12:17 AM
the current.parent is empty in the code. but is filled in the table. the table value isn't give in the current.parent