Display Parent Issue's Status at Point of Creation on Sub-task?

Issue #115 resolved
Will created an issue

Could you describe how to have a field that displays on my Sub-tasks’s (view) screen that displays the status of the parent issue at the time the sub-tasks was created. It should be static and not change even if the parent issue’s status is updated.

Is that possible?

Comments (8)

  1. Fidel Castro Armario repo owner

    Yes, it's possible to do it as I explain now:

    1. Create a "Text Field (single line)" custom field. I will call it "Parent's original status".
    2. Include the new custom field in subtask's view screen.
    3. Insert "Copy a parsed text to a field" in transition "Create Issue" in subtask's workflow, with the following configuration:

    conf-1.png

    Notice that %{00042} is field code for "Parent's issue status" virtual field.

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

    conf-2.png

    Please, insert the post-function after "Creates the issue originally." system post-function.

  2. Will reporter

    This is good, and thank you for the fast reply!

    Could a modification to this be made so that if the parent task is in certain statuses a sub-task can be restricted from being created?

  3. Fidel Castro Armario repo owner

    This is a complete new question, anyway I will answer here: If you want to restrict subtask's creation according to parent's status, you have to use "Boolean validator with math, date-time or text-string terms" at ""Create Issue" transition of subtask's workflow.

    EXAMPLE: We want to allow subtask creation only when parent issue is at statuses "Open", "Reopened" and "In Progress".

    We will add "Boolean validator with math, date-time or text-string terms" at ""Create Issue" transition of subtask's workflow with the following configuration:

    conf-1.png

    Boolean expression used is: %{00042} in ["Open", "Reopened", "In Progress"]

    Notice that %{00042} is field code for "Parent's issue status" virtual field.

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

    conf-2.png

  4. Will reporter

    Amazing, thanks. I will try this right away.

    UPDATE: The validation works. Would it be a similar process to create a field that displays the 'validation failed' message on the sub-task create screen?

  5. Fidel Castro Armario repo owner

    Sorry, I don't understand the question, since the message "Subtask's creation is not allowed for parent issue's current status" is a customized failure message that is shown when trying to create a subtask from an unsuitable parent issue status.

  6. Will reporter

    It's works well, but only appears after clicking submit. Just thought it might be a better experience for the user to know the issue will not be allowed to be made prior to taking the time to complete the form.

    I think I can do it myself using the toolbox but only if the sub-task is aware of its parent at the point of the create screen being presented. That way I can create a big red field that reads "Sub-tasks cannot be created from the current status," or something to that effect.

    EDIT: of course all user will know after we educate them on how to use the project but i'm trying to prepare for the scenario in which someone forgets and fills out a bunch of details that on the screen that may potentially be lost when they have to navigate away from it.

  7. Fidel Castro Armario repo owner

    You can do something like:

    1. Create a "Text Field (single line)" custom field called "Warning Message".
    2. Add the field to parent's issue view screen.
    3. Add "Copy a parsed text to a field" to all transitions with destination unsuitable statuses for subtask creation. Use the following configuration:conf-1.png
    4. Add "Copy a parsed text to a field" to all transitions with destination suitable statuses for subtask creation. Use the following configuration:conf-2.png
  8. Log in to comment