如何维护JIRA中的自定义文件?

时间:2017-10-31 03:27:15

标签: groovy jira

我正在建立JIRA。我做了以下步骤。

  • 创建工作流程(某些流程会触发Reopen Issue Event
  • 创建自定义文件

然后A想要在Reopen Issue Event发生时增加归档 那么如何在groovy中编写Add-On脚本?

enter image description here

1 个答案:

答案 0 :(得分:0)

我知道你要求groovy,但你可以用python解决它。 安装Scripting Suite add-on并将Jython后期功能添加到您的工作流程中,使用以下代码将重新打开转换为列表中的第一个:

from com.atlassian.jira.component import ComponentAccessor
customFieldManager = ComponentAccessor.getCustomFieldManager()


myNumberField = customFieldManager.getCustomFieldObject(10000) # id of your custom field
val = issue.getCustomFieldValue(myNumberField)
newval = 1.0 if not val else val + 1
issue.setCustomFieldValue(myNumberField, newval)

剧透:我是这个附加组件的作者