子任务更新时 JIRA / Greenhopper 更新故事

发布于 2024-11-28 15:54:45 字数 107 浏览 3 评论 0原文

在我的 JIRA/Greenhopper 中,当我将故事下的子任务移至“进行中”时,我可以自动将故事移至“进行中”吗?

此外,当我关闭故事中的所有任务时,它可以自动将我的故事移至关闭。

In my JIRA/Greenhopper, when i move a subtask under story to "In Progress" can I automatically move my story to "In Progress"?

Also when I've closed all the tasks in my story can it automatically move my a story to close.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无戏配角 2024-12-05 15:54:45

您想要做的是将后期功能添加到任务的工作流程转换中,从“打开”到“进行中”。后期功能应将父用户故事从“打开”转换到“进行中”。我使用了 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 版本和您选择的语言。它可能很复杂。复制粘贴以上内容无疑会失败。希望这足以让您开始。
  • 额外资源:answers.atlassian.com

What you want to do is add post-function to the task's workflow transition from "Open" to In Progress". The post-function should transition the parent User Story from "Open" to In Progress". I used the Jira Scripting Suite plugin and a Jython script to do something similar.

Your algorithm would go something like this:

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)

Key points:

  • You don't want to arbitrarily change the issue status. That way madness lies. Instead, transition the issue through its workflow.
  • The actual code for making the transition happen is dependent on your Jira version and the language you choose. It can be complex. Copy-and-pasting the above will doubtless fail. Hopefully it's enough to get you started.
  • Extra resource: answers.atlassian.com.
酒与心事 2024-12-05 15:54:45
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") 

如果我遗漏了什么,请告诉我

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") 

Please let me know , if I am missing something

南…巷孤猫 2024-12-05 15:54:45

安装免费的 JIRA Misc Workflow Extensions 插件
编辑“进行中”过渡,以使用相同的“进行中”过渡(类似于对其自身的引用)添加一个后期函数来过渡父问题。

注意:最好使用转换 ID,因为如果您有多个同名转换,它会默默失败。

Install a free JIRA Misc Workflow Extensions plugin
Edit your "In Progress" transition to add a Post Function to transition parent issue using the same "In Progress" transition (kind of a reference to itself).

Note: Prefer using transition id, as it silently fails if you have several transitions with the same name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文