I have a Jira Script Runner Behaviour that looks at the value that is set in one custom field, and then copies that value in to another custom field.
(我有一个Jira Script Runner Behavior,它查看在一个自定义字段中设置的值,然后将该值复制到另一个自定义字段中。)
This works fine when the first custom field is interacted with.(与第一个自定义字段进行交互时,这可以正常工作。)
However, if I then re-open the edit issue screen after I've already selected a value in the first field, it doesn't automatically populate the value in the second field.(但是,如果我在第一个字段中选择了一个值之后又重新打开了编辑问题屏幕,它将不会自动在第二个字段中填充该值。)
You have to interact with the first field again to make it populate the second field.(您必须再次与第一个字段进行交互,以使其填充第二个字段。)
See code below.
(请参见下面的代码。)
This works when the first field is interacted with, but is there any way to amend it so it works any time a value is already input in to the first field without interaction.(当第一个字段与之交互时,此方法有效,但是有任何方法可以对其进行修改,因此,只要已将值输入到第一个字段而无需交互,它便可以工作。)
def CustomFieldGame = CustomFieldManager.getCustomFieldObject(GameActivityField.getFieldId())
Config = CustomFieldGame.getRelevantConfig(getIssueContext())
OptionToSelect = OptionsManager.getOptions(Config).find { it.value == BudgetBrand }
if (OptionToSelect) {
GameActivityField.setFormValue([OptionToSelect.optionId, "None"])
}
ask by Jamie H translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…