- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 03:35 AM
Hi,
Could you please help me with this case!!
1. When i create the change request, planned start and end date from the change request is not getting populated into the change task. (But when i update the change with new start and end date it is working)
2. Below is my code from Before Business rule(Insert and update) .
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('change_task');
gr.initialize();
gr.addQuery('change_request',current.sys_id);
gr.query();
if(gr.next())
{
gr.planned_start_date = current.start_date;
gr.planned_end_date = current.end_date;
gr.update();
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 09:16 AM
Hi Kamil and Manju thanks for the help!!
I have created the below BR (Before,insert) which helped to populate the start date and end date from the change request to change task.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.planned_start_date=current.change_request.start_date +' ';
current.planned_end_date=current.change_request.end_date +' ';
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 09:16 AM
Hi Kamil and Manju thanks for the help!!
I have created the below BR (Before,insert) which helped to populate the start date and end date from the change request to change task.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.planned_start_date=current.change_request.start_date +' ';
current.planned_end_date=current.change_request.end_date +' ';
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 12:21 AM
You created before insert business rule on sc_task table right?
if yes, any changes done on change for start date and end date won't get updated to task start date and end date field
Mark this answer as correct/helpful based on impact
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 03:29 AM
Hi Manjusha,
I have created before,insert BR on Change_task table. And it is not on sc_task table for your information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2023 04:56 AM - edited 04-07-2023 04:15 AM
Yes i got that you created before insert business rule on change_task table.
After task creation ,if someone updated start date and end date on change record-these changes wont get updated to your task fields as your business rule will execute only once(before record insert)
Mark this answer as correct/helpful based on impact
Thanks,
Manjusha Bangale