Make sub-task status upon create match the parent's current status

Issue #159 resolved
Will created an issue

Related to: https://bitbucket.org/fcarmario/jira-workflow-toolbox/issues/154/move-subtasks-in-sync-with-parent

How can I enforce that when a Sub-task is created it's status is set immediately to the status of its parent issue?

Post-function on creation step of some sort?

Comments (11)

  1. Fidel Castro Armario repo owner

    Hi Will,

    It will be required that a transition from initial status (i.e., destination status for "Create Issue" transition) to every single status in subtask's workflow exists.

    Usually you will want that those transitions from initial status to the rest of statuses won't be used by human JIRA users. You can hide them using condition "Transition is triggered by JIRA Workflow Toolbox post-function". This condition will make those transition only available for JIRA Workflow Toolbox post-functions.

    Once you have created all the necessary hidden transitions from initial status (usually "Open") to the rest of the statuses in subtask's workflow, you will have to insert post-function "Copy a parsed text to a field" in "Create Issue" transition in subtask's workflow with the following configuration:

    conf-1.png

    Once configured, "Create Issue" in subtask's workflow will look like this:

    conf-2.png

    Note that:

    • %{00042} is field code for "Parent's issue status"
    • You should insert "Copy a parsed text to a field" after "Creates de issue originally" post-function.
  2. Will reporter

    This seems to work only when the first sub-tasks is created for an issue, and then not on subsequent sub-tasks. If an issue already has a sub-task, the new sub-tasks do not receive the status of the parent issue. I can't figure out why this is.

    Thanks for all your excellent support so far! _ Will

    UPDATE: And as soon as I submitted this comment I think I've found the culprit. I've set up all transition on the sub-task workflow to use the transition condition "Transition is triggered by JIRA Workflow Toolbox post-function". That hides all transition from the user and is probably disallowing them from making the transition since "The feature will be run as user in field Current User" This is so that users can't transition sub-taks directly; forcing them to follow the parent's lead. Is the best way to fix this to have the feature run by some other user, or as admin?

    UPDATE 2: However, I'm still not sure that's the issues since the first sub-task created seems to work just fine.

  3. Will reporter

    I am trying this out today. Had to prepare our pre-prod area for use first. Thanks for checking in.

  4. Will reporter

    There is a failure somewhere. I think our instances are too far out of sync or maybe production has statuses that don't exist in our pre-prod snapshot yet. I am getting errors likely unrelated to the toolbox. I won't be able to try this out until some other work we are doing in pre-prod is complete and that may be a while.

    Do you think subsequent sub-tasks not inheriting the parent's status is a bug? What's your target release date for 2.2?

  5. Fidel Castro Armario repo owner

    Will,

    Delayed status change takes does transition execution with some delay. This can make UI show non-updated information. Please, try refreshing your browser just after having created the subtask, and check whether it shows the new subtask in the same status as parent issue.

  6. Will reporter

    The result is the same. Our test issues created yesterday still reflect the incorrect status on sub-tasks. Are you able to replicate the issue on your side on the latest stable release? If not, maybe there's just an issue with my implementation of the post-functions..?

    Also worth nothing the the first sub-task created works as desired. Status matches parent task's status immediately.

  7. Fidel Castro Armario repo owner

    Can you please provide me screenshots of conditions, validations and post-functions of the transition that should have been executed in subtask's workflow for moving the subtask to the same status as its parent?

  8. Log in to comment