我的场景是:我的jira工作流程中的一步应该能够取消调度任务,即将修复版本设置为“无”。JIRA - Jira post功能 - 如何更新“修复版本”字段?
我发现我不能够在工作流功能后更新修复版本 - 我完全不知道是什么原因,但无论如何我没有实现JIRA插件来帮助我解决我的问题,但我知道我正在反对jira结构(甚至java良好的编码习惯:))。我不确定我的实现是否会导致问题,但实际上它是在我的jira实例4.1.x中工作的。
如何,我实现了一个插件,以更新后的功能,2种非常相似的方式修复版本:
public class BrandsclubPostFunctionUnschedule extends AbstractJiraFunctionProvider {
// Here I create an empty Collection to be the new value of FixVersion (empty because I need no version in Fix Version)
public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
MutableIssue issue = this.getIssue(transientVars);
Collection<Version> newFixVersion = new ArrayList<Version>();
issue.setFixVersions(newFixVersion);
issue.store();
}
}
public class BrandsclubPostFunctionUnschedule extends AbstractJiraFunctionProvider {
// here I clear the Collection I got from "old" Fix Version and I have to set it again to make it work.
public void execute(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
MutableIssue issue = this.getIssue(transientVars);
Collection fixVersions = issue.getFixVersions();
fixVersions.clear();
issue.setFixVersions(fixVersions);
issue.store();
}
}
我推测,真正的解决办法应该使用类,如:ChangeItemBean,ModifiedValue,IssueChangeHolder - 以CustomFieldImpl(来自jira源代码,项目:jira,包:com.atlassian.jira.issue.fields)的updateValue方法为例。
我在这里发布此点是:
- 有谁知道如何实现包含交函数改变正常修复版本一个JIRA插件?
我没有看到在该教程,显示什么如何修改问题对象。 – mdoar 2015-04-30 23:31:21