JIRA / Greenhopperで、ストーリーの下のサブタスクを「進行中」に移動すると、ストーリーを自動的に「進行中」に移動できますか?
また、ストーリー内のすべてのタスクを閉じると、ストーリーを自動的に閉じて移動できます。
JIRA / Greenhopperで、ストーリーの下のサブタスクを「進行中」に移動すると、ストーリーを自動的に「進行中」に移動できますか?
また、ストーリー内のすべてのタスクを閉じると、ストーリーを自動的に閉じて移動できます。
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")
何か不足している場合はお知らせください
実行したいことは、タスクのワークフロー トランジションに "Open" から "In Progress" への後機能を追加することです。後機能は、親ユーザー ストーリーを "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)
キーポイント:
無料のJIRA Misc Workflow Extensions プラグインをインストールし ます 「進行中」トランジションを編集して、同じ「進行中」トランジション (それ自体への参照のようなもの) を使用して親課題をトランジションする事後操作を追加します。
注: 同じ名前のトランジションが複数ある場合、サイレントに失敗するため、トランジション ID を使用することをお勧めします。