pass related project value from change request to non prod change task field

raj765_32
Tera Contributor

Hello can anyone please help me with the requirement for :

There is a field on change request called as 'Related project' field and its a list type variable,

my requirment is that we have a module/ application called as 'Non Prod Change Task' and in that i have created a same field ' Related Project' and what ever the value is in change record's ' Related project' should be seen in non prod change task ' Related Project' field.

 

attaching the screen shots for reference one from change request and another from non prod change task

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @raj765_32 

 

https://www.servicenow.com/community/itsm-forum/copy-field-values-from-change-request-to-task-throug...

 

https://www.servicenow.com/community/incident-management-forum/how-to-pass-a-list-field-value-from-c...

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

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

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @raj765_32 

 

https://www.servicenow.com/community/itsm-forum/copy-field-values-from-change-request-to-task-throug...

 

https://www.servicenow.com/community/incident-management-forum/how-to-pass-a-list-field-value-from-c...

*************************************************************************************************************
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 atul no it is not working .. below is my code written in after BR with insert and update 

 

written br in non prod change task table.

 

(function executeRule(current, previous /*null when async*/) {

var gr = new GlideRecord('change_request');

gr.addQuery('change_request', current.sys_id);
gr.query();
while(gr.next()){
gr.u_related_project = current.parent.u_related_project;

gr.update();
}
})(current, previous);