If changes in parent incident I need to change in child incident as parent incident

Siva82
Tera Expert

Hi all.

If i am changing the parent state and on hold fields then i need change the child state and on hold fields.

for this I using after business. But getting results.

Can you help me on that.

Can please refer attachment for my business rule .

find_real_file.png

find_real_file.png

Thank you

1 ACCEPTED SOLUTION

Sulabh Garg
Mega Sage
Mega Sage

Hello

Please change the script like this..

var incident = new GlideRecord('incident');
incident.addQuery('parent', current.sys_id);
incident.query();
while(incident.next()){

incident.state = current.state;

incident.update();

}

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

View solution in original post

13 REPLIES 13

On Which Table have you written this BR on?

Can you put a log after line number 9 as below:

gs.info('value of State' + current.state);

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi shloke,

This code working my in instance.

Early parent name different my instance (u_parent_incident).That's way getting error.

now works good 

thank you for helping me

I will leave it up to you to decide and mark the appropriate answer as correct, but I have given the working script first on this thread and the issue was with a custom field being used which is difficult for anyone in community to know what is customized at your end.

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Thanks Siva for marking my response as correct, It will help us in closing the thread and others can be benefitted.

 

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg