Custom field “copy change” ootb ui action

Rocky5
Kilo Sage

Hello,

 

We have a custom group field on change request form. And I have given that field name in system property so that when we “copy change” ui action that custom field also gets copied to new change request. But, if we create a change request with a group ‘A’ in the custom field and if that group ‘A’ is deactivated later and if we then use ootb “copy change” ui action the inactivated group ‘A’ is also copied to new change request. But I want to avoid copying inactive groups. 
how can I do that ? We are using ootb copy change ui action.

 

Thanks,

Rocky.

10 REPLIES 10

RaghavSh
Kilo Patron

This will be a complex change, if you go via updating the "copy change" Ui action because it used OOB script include.

 

There is a simpler solution to this, write a before insert BR on change table, with below script:

 

if(current.assignment_group.active==false)

{

current.assignment_group=' ' ;

}


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

Hi Raghav,

 

This did not work, though I have a before insert BR. The inactive group is still getting copied over to new change request.

 

The ‘current’ object refers to the original change request right? How will it refer to the new change request and make that field blank?

 

thanks,

Rocky.

Try below in same BR:

 

if(current.assignment_group.active=="false")

{

current.assignment_group=' ' ;

}


Raghav
MVP 2023

Hi Raghav,

 

No it didn’t work. I have also tried giving condition in the condition builder. Still no luck.

 

thanks,

Var**bleep**h Cherukuri.