在我的JIRA/Greenhopper中,当我将故事下的一个子任务移动到“进行中”时,我可以自动将我的故事移动到“进行中”吗?
此外,当我关闭了故事中的所有任务时,它是否可以自动将我的故事移动到关闭。
发布于 2011-08-31 05:03:28
你要做的是将post-function添加到任务的工作流程中,从"Open“过渡到”In Progress“。post-function应该将父用户Story从"Open”过渡到“In Progress”。我使用了Jira Scripting Suite插件和一个Jython脚本来做类似的事情。
你的算法应该是这样的:
parentUserStory = task.getParentObject()
if (parentUserStory.getStatusObject().getName() == "Open"):
inProgressTransitionID = 41 # This is the id of the transition from Open -> In Progress in the User Story workflow*
workflowManager = ComponentManager.getInstance().getWorkflowManager()
userStoryWorkflow = workflowManager.getWorkflow(parentObject)
usCurrentStep = userStoryWorkflow.getLinkedStep(parentObject.getStatus())
listOfActions = usCurrentStep.getActions()
for act in listOfActions:
if str(act) == "In Progress":
break
else:
log.debug("No match: " + str(act))
iIP = IssueInputParametersImpl()
issueService = ComponentManager.getInstance().getIssueService()
transitionValidationResult = issueService.validateTransition(issue.getAssignee(),parentObject.getId(),act.getId(),iIP)要点:
发布于 2012-04-10 19:05:26
currUser = ComponentManager.getInstance().getJiraAuthenticationContext().getUser()
currUserName = currUser.getName()
issueServiceObj = ComponentManager.getInstance().getIssueService()
issueParamImpl = IssueInputParametersImpl()
issueParamImpl.setAssigneeId(currUserName)
issueId = issue.getId()
transValiRes = issueServiceObj.validateTransition(currUser,issueId,91,issueParamImpl)
if(transValiRes.isValid()):
System.out.println("Transition validated")
transitionResult = issueServiceObj.transition(currUser,transValiRes)
else:
System.out.println("in else") 如果我遗漏了什么,请让我知道
发布于 2012-08-28 23:40:09
安装一个免费的JIRA Misc Workflow Extensions plugin编辑你的“进行中”转换,添加一个Post函数来使用相同的“进行中”转换(一种对自身的引用)转换父问题。
注意:最好使用转换id,因为如果您有几个具有相同名称的转换,它会自动失败。
https://stackoverflow.com/questions/7014089
复制相似问题