Update source on communication plan table

Nisha Mishra23
Tera Contributor

I want to  source to auto populate with change request number when we create communication plan from communication task 

NishaMishra23_0-1768471703106.png

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@Nisha Mishra23 

how is CHG related to Communication Plan and Communication Task?

share some more screenshots and details

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

Nisha Mishra23
Tera Contributor

NishaMishra23_1-1768479471461.png

Once we click on new under communication task then we get 

NishaMishra23_2-1768479519529.png

 

After that we have to click on communication plan create new communication plan then we get  below form and we need change request autopopulatethere.

NishaMishra23_3-1768479603519.png

 

@Nisha Mishra23 

parent field on form already has CHG, you can use display BR on communication task table and set the Source field

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

I am using below code but still not getting the change number
(
function executeRule(current, previous /*null when insert*/) {

   
    if (!current.comm_task.nil()) {

        var commTaskGR = new GlideRecord('comm_task');
        if (commTaskGR.get(current.comm_task)) {

            
            if (!commTaskGR.parent.nil()) {

                var changeGR = new GlideRecord('change_request');
                if (changeGR.get(commTaskGR.parent)) {

                   
                    current.comm_plan.source = changeGR.number;
                }
            }
        }
    }

})(current, previous);