- 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
03-31-2023 08:49 AM
Thanks for the Reply!! We tried in the same way. But the same issue occurred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 08:57 AM
Is you BR setup to run After or Before?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 01:52 AM
My BR is setup to After only as you suggested
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 11:31 PM
Just add info message in your business rule and check whether it is executing or not
use gs.addInfoMessage("Checking br");
Thanks,
Manjusha Bangale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 01:52 AM
Sure Manju!!
Will try in the same way.