I am new to Scriptrunner so bear with me... I am trying to set the value of a custom field based on the value of another custom field. When I make the change to the issue I can see that the secondary field is updating, however I don't see this change for a while in my filters. They still display the original field values. Eventually they catch up. Is there some sort of time delay in propagating these changes to the filters? I don't really understand what is going on. Here is my code:
def ClosureCode = getFieldByName("Closure Code")
def piReview = getFieldByName("PI Review")
def ClosureCodeValue = ClosureCode.getFormValue();
def piReviewValue = piReview.getFormValue();
log.error("TEST LOG BEHAVIOR")
log.error("Closure Code is "+ClosureCodeValue)
log.error("PI Review is "+piReviewValue)
log.error("TEST LOG BEHAVIOR")
if (ClosureCodeValue=="11314") //Successful set to N/A
{
log.error("Successful closure code")
(piReview=="11328")
piReview.setFormValue("11328")
}
if (ClosureCodeValue=="11316") // Unsuccessful set to pending
{
log.error("Unsuccessful closure code")
(piReview=="11341")
piReview.setFormValue("11341")
}
I am not sure which of the two methods is correct to set the value so i am using both....