在我的JIRA / Greenhopper中,当我将故事中的子任务移动到“正在进行中”时,我可以自动将我的故事移至“正在进行中”吗?
当我关闭故事中的所有任务时,它会自动将我的故事关闭。
答案 0 :(得分:1)
您要做的是将后期功能添加到任务的工作流程从“打开”转换为“正在进行”。后期功能应将父级用户素材从“打开”转换为“正在进行”。我使用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)
关键点:
答案 1 :(得分:1)
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")
如果我遗失了某些内容,请告诉我
答案 2 :(得分:0)
免费安装JIRA Misc Workflow Extensions plugin 编辑“进行中”转换以使用相同的“进行中”转换(对自身的引用类型)添加后期函数以转换父问题。
注意:首选使用转换ID,因为如果您有多个具有相同名称的转换,它会无声地失败。