Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
310 views
in Technique[技术] by (71.8m points)

javascript - Jira脚本运行器行为在加载时而非单击时(Jira Script Runner Behaviour On load Rather than On Click)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...