Take value date/time from table change task and put in field in change request

Yahav Mor
Tera Contributor

When I have a task   I need to take  from field Expected start

the time and date 

YahavMor_0-1707132803781.png

and put in the field work start in change request

YahavMor_1-1707133028364.png

 and if I have a new task the field  work start is  change to the new Expected start

 

1 ACCEPTED SOLUTION

Prashant Ahire
Kilo Sage

Hello @Yahav Mor  
Write a Business rule on change_task table which will be triggered whenever the new task is created.

When to Run: After Inster

Advanced:

    var gr = new GlideRecord("change");
    gr.addQuery("sys_id", current.change_request);
    gr.query();
    while (gr.next()) {
        gr.work_start = current.expected_start; //verify the field names
        gr.update();
    }

 

Please check and Mark Correct and Helpful if it really helps you.
Regards,
Prashant Ahire

View solution in original post

2 REPLIES 2

Prashant Ahire
Kilo Sage

Hello @Yahav Mor  
Write a Business rule on change_task table which will be triggered whenever the new task is created.

When to Run: After Inster

Advanced:

    var gr = new GlideRecord("change");
    gr.addQuery("sys_id", current.change_request);
    gr.query();
    while (gr.next()) {
        gr.work_start = current.expected_start; //verify the field names
        gr.update();
    }

 

Please check and Mark Correct and Helpful if it really helps you.
Regards,
Prashant Ahire

Quick and clear @Yahav Mor  

*************************************************************************************************************
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]

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