Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel
titleClone an Epic and its Stories

Create a sequence

  1. Add the Sequence of post-functions post-function to the "Clone now" transition.

  2. Click on "Add post function" 

  3. Clone Epic: Add the Create issue post-function.

    1. Select the destination project from Project

    2. Select the Issue type as "Epic"

    3. Select the link type as "is cloned by"

    4. Using the "Set fields of the new section"

      1. Select the "Epic Name" field

      2. Select the "Copy value from current issue" option

    5. Save the post-function.

  4. Clone Stories: Add a "Transition Linked Issues" post-function configured as

    1. Input the transition name as "Clone Stories" (will be created later)

    2. Select the Link type as "is cloned by"

    3. Save the post-function.

  5. Click on "Add"

  6. Publish the workflow

Create "Clone Stories" transition

  1. On the Epic workflow of the destination project (on the same workflow if both Epics share the same workflow), create a transition named "Clone Stories" on the Create transition to the same initial status.

  2. Hide that transition from users by adding a "Hide From User Condition"

Clone Stories: Add the Create issue post-function to the "Clone Stories" transition

  1. Select the Project as "Same as current issue"

  2. Select the "Issue Type" as "Story"

  3. Input the Summary as:

    Code Block
    {{it.fields.summary}}
  4. Select the "Epic Link" field under "Set fields of new issue"

    1. Select "Set field value to" option

    2. Input the following template

      Code Block
      {{issue.key}}
  5. Select "Create Multiple Issues" checkbox under "Multiple issue creation"

  6. In the iterator write the following script:

    Code Block
    {% set from = issue | issueProperty("jmwe-created-from") | field("key") %}
    {{issue | linkedIssues( "clones" ) | firstfind({key:from}) | stories | dump(2) }}

    (note that "clones" here is the name of the reverse direction of the "is cloned by" link type used above).

  7. Select "Iterator returns JSON" option

  8. Click on "Add"

  9. Publish the workflow

Now when you trigger the transition "Clone now" the Epic and its Stories are cloned to the new project.

...

Panel
titleClone an Epic and its Stories

Create a sequence

  1. Add the Sequence of post-functions post-function to the "Clone now" transition.

  2. Click on "Add post function" 

  3. Clone Parent: Add the Create issue post-function.

    1. Select the destination project from Project

    2. Select the Issue type as "Calculated"

    3. Input the template {{ issue.fields.issuetype.name }}

    4. Select the link type as "is cloned by"

    5. Save the post-function.

  4. Clone Subtasks: Add a "Transition Linked Issues" post-function configured as

    1. Input the transition name as "Clone Subtasks" (will be created later)

    2. Select the Link type as "is cloned by"

    3. Save the post-function.

  5. Click on "Add"

  6. Publish the workflow

Create "Clone Subtasks" transition

  1. On the parent workflow of the destination project (on the same workflow if both parent and subtask share the same workflow), create a transition named "Clone Subtasks" on the Create transition to the same initial status.

  2. Hide that transition from users by adding a "Hide From User Condition"

Clone Subtasks: Add the Create issue post-function to the "Clone Subtasks" transition

  1. Select the Project as "Same as current issue"

  2. Select the "Issue Type" as "Sub-task"

  3. Select the “Parent issue” as “Current issue”

  4. Input the Summary as:

    Code Block
    {{it.fields.summary}}
  5. Select "Create Multiple Issues" checkbox under "Multiple issue creation"

  6. In the iterator write the following script:

    Code Block
    {% set from = issue | issueProperty("jmwe-created-from") | field("key") %}
    {{issue | linkedIssues( "clones" ) | firstfind({key:from}) | storiessubtasks | dump(2) }}

    (note that "clones" here is the name of the reverse direction of the "is cloned by" link type used above).

  7. Select "Iterator returns JSON" option

  8. Click on "Add"

  9. Publish the workflow

Now when you trigger the transition "Clone now" the Parent and its subtasks are cloned to the new project.

...