- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 09:14 PM
Change task planned start/end date should be same as Change request , also when Change Request planned dates are updated , Change Task planned date should be updated as well
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 09:59 PM
Hi,
Please write a After Insert and Update Business Rule on Change request table and use the script as below:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('change_task');
gr.addQuery('change_request',current.sys_id);
gr.query();
while(gr.next()){
gr.planned_start_date = current.start_date.getDisplayValue();
gr.planned_end_date = current.end_date.getDisplayValue();
gr.update();
}
})(current, previous);
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 09:44 PM
Hi,
You can write after/async BR on change request. And then query change tasks and copy the date/time in change tasks.
Regards,
Kamal Soni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 09:54 PM
I wrote After Insert and Update BR on Change Request Table as below : But its not working ..can someone suggest ?
var ct = new GlideRecord('change_task');
ct.addQuery('change_request', current.getvalue('change_request'));
ct.query();
{
if (current.start_date.changes()) {
ct.u_planned_start_date = current.start_date;
ct.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 10:03 PM
mention condition in condition builder in BR. like any date changes.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ct = new GlideRecord('change_task');
ct.addQuery('change_request',current.sys_id);
ct.query();
while(ct.next()){
ct.planned_start_date = current.start_date.getDisplayValue();
ct.planned_end_date = current.end_date.getDisplayValue();
ct.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 09:59 PM
Hi,
Please write a After Insert and Update Business Rule on Change request table and use the script as below:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('change_task');
gr.addQuery('change_request',current.sys_id);
gr.query();
while(gr.next()){
gr.planned_start_date = current.start_date.getDisplayValue();
gr.planned_end_date = current.end_date.getDisplayValue();
gr.update();
}
})(current, previous);
Regards,
Shloke