Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Populate task with Assignment Group from the Parent

turnea
Mega Expert

Hi everyone,

In our instance we had created a table for Application Enhancements (u_app_enhancement) and once approved, an Enhancement Task (u_enhancement_task) is auto-generated.   I'm looking for a Client Script where the Assignment Group (variable 'assignment_group') populates the task's Assignment Group (variable 'u_assignment_group').   I've been trying some onChange and onLoads but none are working (I'm fairly novice at these) and I'm hoping someone can help me out.   I use the Parent field for the Application Enhancement for the Client Script.

Any help would be greatly appreciated.

Thank you,

Amandah

1 ACCEPTED SOLUTION

manikorada
ServiceNow Employee
ServiceNow Employee

Amandah,



You can have a Client Script something like:



var ref = g_form.getReference('parent');


g_form.setValue('u_assignment_group', ref.assignment_group);



But make sure that the field 'parent' is on the form.



Also, If you wold like to set this up on creating of Enhancement Task I will go with   a business rule rather than Client Script.


You can have a businsess rule run on insert and have a script something like:



current.u_assignmnet_group = current.parent.assignment_group;


View solution in original post

1 REPLY 1

manikorada
ServiceNow Employee
ServiceNow Employee

Amandah,



You can have a Client Script something like:



var ref = g_form.getReference('parent');


g_form.setValue('u_assignment_group', ref.assignment_group);



But make sure that the field 'parent' is on the form.



Also, If you wold like to set this up on creating of Enhancement Task I will go with   a business rule rather than Client Script.


You can have a businsess rule run on insert and have a script something like:



current.u_assignmnet_group = current.parent.assignment_group;