How to update a story's target start and end dates based on the sprint dates using Jira Automation

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

目的

Automation for Jira does not have native support for configuring the Jira fields "Target Start" and "Target End". When selecting "choose fields to set..." in an Edit issue action, for example, the fields are not present in the drop down.

This feature request is being tracked at JIRAAUTOSERVER-159

Using Smart Fields, however, we can overcome this limitation. The solution below explores how to update the "Target Start" and "Target End" fields based on the issue's sprint using Jira Software's Automation feature

ソリューション

Automation Rule

  • In the lower left corner of your Jira project, click Project Settings
  • On the left pane, choose Project automation
  • Create Create rule to create a new rule
  • Trigger: Sprint Started
    • Boards: Pick your boards
  • New Component: Branch Rule / related Issues
    • Type of related issues: Issues in the sprint
    • Rule restricted to project: Your project
    • New Action: Edit Issue
      • Under Additional Fields, enter:
      • {
          "fields": {
            "Target start": "{{issue.sprint.last.startDate.jiraDate}}",
            "Target end": "{{issue.sprint.last.endDate.jiraDate}}"
          }
        }

The completed rule should look like this:

結果

Once the sprint is started, issues within that sprint will have their Target Start date set to the sprint's start date, and the Target End date set to the sprint's end date

Theory of operation

Sprint started triggerAutomation for Jira will listen for the Jira event when a Sprint is started, and execute the rule
Branch Rule

The trigger Sprint Started does not present an issue list to subsequent actions. Therefore in order for the issue update action to target any issues, we specify the branch rules action to fetch Issues in the sprint

The rule restricted to projects setting minimises the number of issues being looked up for efficiency

Edit issue fields action

This action updates the Jira issues provided by the branch rule. While the target fields are not listed in the drop down, we leverage the additional fields section and Smart Values to update the sprint. Breaking down each smart value element:

  • issue  - the Jira issue
  • sprint  - looks up the "Sprint" field for that issue
  • last  - the latest sprint, required if the issue has been in multiple sprints in the past. The latest sprint will always be the active sprint unless the parallel sprints feature is enabled. This means that this solution will not work with parallel sprints turned on. If last  is omitted, the first sprint will be returned which is not desirable
  • startDate|endDate  - the sprint's start or end date
  • jiraDate  - transform the long style date provided by sprint into a short style date that the Advanced Roadmaps Target start | Target end fields can ingress. If not used, Unparseable date  error will be raised

その他の情報


説明 How to update a story's target start and end dates using Jira Automation
製品Automation for Jira
最終更新日: 2022 年 12 月 28 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.