在我的JIRA/Greenhopper中,當我將故事下的子任務移動到「正在進行」時,是否可以自動將我的故事移動到「進行中」?當子任務更新時,JIRA/Greenhopper更新故事
另外,當我關閉了故事中的所有任務後,它會自動移動我的故事關閉。
在我的JIRA/Greenhopper中,當我將故事下的子任務移動到「正在進行」時,是否可以自動將我的故事移動到「進行中」?當子任務更新時,JIRA/Greenhopper更新故事
另外,當我關閉了故事中的所有任務後,它會自動移動我的故事關閉。
您想要做的是爲任務的工作流程從「打開」轉換爲「正在進行」添加後期功能。後期功能應該將父用戶故事從「打開」轉換爲「正在進行」。我使用了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)
要點:
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")
請讓我知道,如果我失去了一些東西
安裝一個免費的JIRA Misc Workflow Extensions plugin 編輯你的「進行中」過渡到增加一個POST功能使用相同的「正在進行轉型父問題「過渡(對自身的一種參照)。
注意:首選使用轉換ID,因爲如果您有多個具有相同名稱的轉換,它將自動失敗。
不幸的是,不再免費。 – Dan