如何使用jira中的侦听器获取自定义字段的字符串值(单选项)
我是JIRA的新学习者,我没有脚本跑步者的经验,我尝试在Scriptrunner中编写脚本,每当用户选择“其他”选项时,该脚本会启动。 “另一个”是我在自定义字段中添加的四个选项之一,该字段的类型是单个选择。 我所做的是Open Scriptrunner>创建听众>选择自定义听众>选择项目>并编写此脚本:
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObjectByName("impacted")
def cFieldValue = issue.getCustomFieldValue(cField)
If cFieldValue== "Other"
return "there is no another option"
此脚本不适合我。任何人都可以给我吗? 有人可以给我建议或帮助脚本吗?
I am a new learner of Jira and I have no experience with Script runner, And I trying to Write a script in ScriptRunner that gets initiated every time a user selects the “other” option. the "other" is one of four options which I added it under custom field and the type of this field is single select.
what i have done is open scriptrunner> create listener> choose Custom listener> select the project> and write this script:
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cField = customFieldManager.getCustomFieldObjectByName("impacted")
def cFieldValue = issue.getCustomFieldValue(cField)
If cFieldValue== "Other"
return "there is no another option"
this script didn't work with me. can any one give me .
Can someone give me advice or help for script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需附加.toString()
maby您就可以用以下方式替换整个代码
Simply append a .toString()
Maby you can replace your whole code with: