Change task picking up planned start/ end date from the master change record

NishaB
Tera Expert

Hi,

I have a new client requirement that whether it is possible for the change tasks to pick up the planned start/end dates from the master change record. 

4 REPLIES 4

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @NishaB 

Yes, you can do this, but logically it's not the best approach. The reason is that a change has a duration that covers all associated tasks. If you copy the total change time to each individual task, it implies that you're allocating the full duration to each task separately, which is misleading.

For example:

  • Change duration: 2 hours

  • Task 1: 30 minutes

  • Task 2: 1 hour

  • Task 3: 15 minutes

  • Task 4: 15 minutes

If you assign the full 2 hours to each task, it gives the wrong impression and inflates the actual effort involved. So, logically, it's better not to do this.

However, if you still want to distribute the change time to the tasks, you’ll need to manually adjust the time for each task based on actual effort—which adds extra work for the user.

 

https://www.servicenow.com/community/developer-forum/copy-change-request-planned-start-date-and-end-...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @NishaB 

 

did you check my response? The link has a working solution.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@NishaB 

I agree with what Atul says, ideally not each change tasks takes the complete CHG duration

but if you still require then you can use before insert business rule on change_task table and set the values from CHG

 

(function executeRule(current, previous /*null when async*/) {
    // Get the parent Change Request record
    var parentChange = current.change_request.getRefRecord();
    if (parentChange.isValidRecord()) {
        // Copy the planned dates from Change Request to Change Task
        current.planned_start_date = parentChange.start_date;
        current.planned_end_date = parentChange.end_date;
    }
})(current, previous);

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@NishaB 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader