Versions Compared

Key

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

On this page

Table of Contents
maxLevel1
excludeOn this page
typeflat
separator |

Include Page
_RecipeTemplateTopLogo
_RecipeTemplateTopLogo

Recipe overview

This recipe provides step-by-step instructions on how to use the Update On Transition for JIRA add-on during a workflow transition to automatically add a comment to a linked issue. This automation is particularly helpful when one issue is blocking another and you want to ensure the Assignee of the blocked issue is aware that notified when the impediment has been resolved.

You will need JIRA Administrator permissions to your JIRA instance in order to complete this recipe.

(info) It will take you approximately 12-13 11 minutes to complete this recipe.

Recipe level

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
enableSortingfalse
classingredients_table
enableHighlightingfalse

...

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
idsteps_table
enableSortingfalse
enableHighlightingfalse

How to Automatically Transition a Linked Issue During a Workflow Transition

Create a JIRA project to use with this recipe

Div
classtime

 Estimated Time: 2 min

In this step, you are going to create a project you will use when creating a standard Story for an Epic. To do this, log on to your JIRA instance as a JIRA Administrator and do the following:

  1. From the Projects menu, choose Create Project.
  2. In the Select Project Type screen, select Simple Issue Tracking and click Next.
  3. The second screen shows the Issue Types that will be used (Task and Sub-task). Click Select.
  4. The third screen prompts you to supply a Name and Key for your new JIRA project.
    1. Use Recipe Update On Transition as the Name.
    2. Use RUOT as the Key.
    3. Click Submit to create the project, with you set as its Project Lead.
  5. If you click Create and choose Recipe Update On Transition as the Project and Task as the Issue Type, you will see a Create Issue screen like the one shown to the right. Only 3 fields (Project, Issue Type, and Summary) are required, as indicated by the red asterisk next to their field labels. There are 2 optional fields: Priority and Description.

In the next step, you'll create 2 sample issues, so leave the Create Issue screen open.

Anchor
step1
step1
Create Issue screen:

Expand
titleView all screens for the Create Project wizard...

First screen:

Second screen:

Third screen:


How to Automatically Transition a Linked Issue During a Workflow Transition

Create 2 sample issues

Div
classtime

Estimated Time: 1 min

In this step, you will create 2 sample issues that will be used to test the workflow transition you'll be adding in a later step.

  1. On the Create Issue screen, fill in the fields as shown in the first table on the right and then click Create. Take note of the issue key that was created.
  2. Click Create again. Then, flll in the fields as shown in the second table on the right and click Create. Take note of the issue key that was created.
  3. Go to the first issue you created. and do the following:
    1. From the More menu, choose Link.
    2. Fill in the fields as shown in the screenshot to the right. (Your issue keys might be different, but you should be viewing the first issue while creating a "blocks" link from it to the second issue.)
    3. Click Link to save this link. You should now see the link showing in the "Issue Links" section of the View Issue screen.

Anchor
step2
step2
Fields for creating the first issue:

ProjectUpdate On Transition (RUOT)
Issue TypeTask
SummaryThis issue blocks another


Fields for creating the second issue:

ProjectUpdate On Transition (RUOT)
Issue TypeTask
SummaryThis issue is blocked by another


Link screen, to link the first issue to the second issue:


How to Automatically Transition a Linked Issue During a Workflow Transition

Create a draft workflow

Div
classtime

Estimated Time: 1 min

In this step, you will edit the workflow used by the Recipe Update On Transition project so you can begin the process of adding the Update Transition post function that will create a comment on the linked issue.

  1. From the Cog menu ( ) , choose Projects.
  2. Click the Recipe Update On Transition link to display the Project Summary page which shows how the project is configured.
  3. In the Workflows section of the page, click the pencil icon () next to the RUOT: Simple Issue Tracking Workflow link to edit that workflow.
  4. Click the  button so that the workflow is shown in Text mode rather than Diagram mode.
  5. There are 2 transitions named "Done": one is in the To Do step and the other is in the In Progress step. In the next step, you will be adding a new post function to both of these transitions.

 

Anchor
step3
step3
RUST: Simple Issue Tracking Workflow screen:


How to Automatically Transition a Linked Issue During a Workflow Transition

Add a post function on the Done transitions

Div
classtime

 Estimated Time: 1 3 min 

In this step, you will add a post function on the two Done transitions.

From the RUOT: Simple Issue Tracking Workflow screen, do the following steps twice:

  • once for the Done transition under the To Do step, and
  • again for the Done transition under the In Progress step.
  1. Click the Post Functions tab to display the post functions. Your screen should look like the first screenshot shown to the right.
  2. Click the Add post function link to display the Add Post Function To Transition screen.
  3. Select Update issues and then click Add. The Add Parameters To Function screen will be displayed.
  4. Set the parameters as shown to the right:
    1. Issues to Update:  This uses the %jql_result_list%substitution variable to indicate that the issue(s) being updated are based on what is returned by the JQL query specified in the JQL Query parameter.
    2. JQL Query: Thisindicates how to identify the issues to act upon. In this example, it is looking for issues that the issue currently being transitioned to Done is blocking. In other words, the current issue has a "blocks" link defined to those other issues.
    3. Comment: This indicates the comment to add to those other issues that will be updated.

      Info

      No other parameters need to be changed. JIRA will ignore any field that does not appear on the transition screen for the Done transition.

  5. Click Add to save your changes to the parameters and add the Update Issues post function.

 

Note
titleImportant!

Be sure to add this post function to both "Done" transitions!

 

 

 

Anchor
step3
step3
Add Post Function To Transition screen:

Post Function parameters:

Issues to Update%jql_result_list%
JQL Queryissue in linkedIssues(%original_key%, "blocks") AND status = "To Do"
CommentThe issue which had blocked this one (%original_key%) is now unblocked so work on this issue can now proceed.


Expand
titleView Transition: Done screen, before and after adding post function...

To Do step's Transition: Done screen, before any changes:

To Do step's Transition: Done screen, after any changes:


How to Automatically Transition a Linked Issue During a Workflow Transition

Publish the draft workflow

Div
classtime

 Estimated Time: 1 min 

In this step, you will publish the draft workflow so you can test it.

From the Transition: Done screen, do the following:

  1. Click the Publish Draft button at the top of the screen to publish your draft workflow. The Publish Draft Workflow screen will appear.
  2. When prompted whether to save a backup copy, click Yes and then click Publish.

 

Anchor
step4
step4
Publish Draft Workflow screen:



How to Automatically Transition a Linked Issue During a Workflow Transition

Test the post function

Div
classtime

 Estimated Time: 3 min 

In this step, you will verify the post function is working as intended.

  1. Open the first sample issue you created. It is the one with the Summary indicating "This issue blocks another."
  2. Test the To Do → Done transition:
    1. Click the  workflow button to execute the To Do → Done transition.
    2. Accept the default values on the transition screen that appears and click Done.
    3. The first sample issue should now appear in a Done status.
    4. In the Issue Links section of the screen, click the link to the second sample issue that has the Summary indicating "This issue is blocked by another" to open it.
    5. The second sample issue should now have a comment added that matches what you specified in the post function in Step 3.
  3. Test the In Progress → Done transition:
    1. Go back to the first sample issue you created. It is the one with the Summary indicating "This issue blocks another."
    2. Click the workflow button to reopen the first sample issue and move it to the In Progress status.
    3. Next, click the  workflow button to execute the In Progress → Done transition.
    4. The first sample issue should again appear in a Done status.
    5. In the Issue Links section of the screen, click the link to the second sample issue that has the Summary indicating "This issue is blocked by another" to open it.
    6. The second sample issue should now have a second comment added that matches what you specified in the post function in Step 3.

That's it! By adding a post function to add a comment to each linked issue when the issue blocking it has been resolved, you can be assured that the Assignee of those other issues is notified immediately that work can now proceed. This improves communication and saves time!

 

Tip
titleBest Practice

If your post function is malfunctioning in any way, enable additional DEBUG logging as described here so that the Update On Transition add-on writes additional information to the JIRA log file. This information will help you understand the cause of the problem and how to resolve it.

You may also want to read our tips on the Update On Transition add-on.

Anchor
step5
step5
First sample issue, after being transitioned to Done:



Second sample issue, after the first sample issue is transitioned to Done (from the To Do status):

Second sample issue, after the first sample issue is transitioned to Done (from the In Progress status):

...