概述
任务流转时通过groovy 对节点进行 Validator
import com.atlassian.jira.event.issue.IssueEvent;
import com.atlassian.jira.issue.Issue;
import com.opensymphony.workflow.InvalidInputException;
import java.util.Collection;
Collection<Issue> issues = issue.getSubTaskObjects();
for (Issue issue1 : issues){
String status = issue1.getStatusId();
String summary = issue1.getSummary();
String issueTypeId = issue1.getIssueTypeId();
if(status.equals("10001")){
log.error("Validator OK status: {}, summary: {}, issueType:{}", status, summary, issueTypeId);
}else {
log.error("Validator Error status: {}, summary: {}, issueType:{}", status, summary, issueTypeId);
InvalidInputException error= new InvalidInputException();
error.addError("终止任务");
// 抛出错误以终止节点
throw error;
break;
}
}
Validator中内置的变量
{
issue=MIX-1,
configuration=com.opensymphony.workflow.config.DefaultConfiguration@4122bc8c,
proj=Project: MIX,
project=
[GenericEntity:Project]
[name,MixProject]
[assigneetype,3]
[description,]
[projecttype,software]
[id,10300][counter,0]
[avatar,10324]
[originalkey,MIX]
[url,]
[lead,shangwenhe]
[key,MIX],
currentSteps=[SimpleStep@6[owner=, actionId=0, status=null]],
store=com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore@8bf4cb5,
descriptor=com.atlassian.jira.workflow.ImmutableWorkflowDescriptor@5f43fe9,
userKey=shangwenhe,
originalAssigneeId=null,
entry=com.opensymphony.workflow.spi.SimpleWorkflowEntry@595d8839,
context=com.opensymphony.workflow.basic.BasicWorkflowContext@16ff9ae,
originalissueobject=MIX-1,
actionId=51,
pkey=MIX,
transaction=com.atlassian.jira.transaction.TransactionSupportImpl$TransactionImpl@399a9352
}
最后
以上就是雪白玉米为你收集整理的jira 终止任务的全部内容,希望文章能够帮你解决jira 终止任务所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复