How to automate a label addition when sprint is closed

João Ribeiro July 24, 2024

Hi,

I would like to automate a spillover label addition when a sprint is closed and also add a comment to that effect.

Many thanks for all the help!

2 answers

1 accepted

0 votes
Answer accepted
Neil Fletcher
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2024

hi @João Ribeiro 

Something like this should work...

Use the trigger: When Sprint is completed - add the board that references the sprint

+

Edit - labels

+

Add - comment

 

2024-07-24_09-20-37.png

João Ribeiro July 24, 2024

Hi @Neil Fletcher ,

Thanks for the quick reply. Maybe I did not explain my query correctly, but I only want to add the label & comment for open tickets when the sprint closes. I've tried to set this up, but getting this warning:

Screenshot 2024-07-24 at 12.54.05.png

Any clue why?

Neil Fletcher
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2024

Adding a branch will get you past 'incompatible component' message

To select open tickets only, I added a JQL condition: statuscategory != Done

(I use statuscategory instead of status as statuscategory is only: To Do, In Progress or Done... all statuses are always grouped beneath these choices.)

 

2024-07-24_14-59-57.png

this is the result for open issues when the current sprint is closed.

The sprint moves to the next one, a comment is added and the label is updated

 

2024-07-24_15-00-34.png

João Ribeiro July 24, 2024

Thanks @Neil Fletcher

Like Neil Fletcher likes this
0 votes
Julio Herrera July 24, 2024

Automating label addition when a sprint is closed can be achieved by leveraging workflow automation tools provided by project management platforms like Jira, Trello, or GitHub. Here's how you can approach this automation using different tools:


Using Jira-

Jira provides powerful automation features that can be used to automate tasks such as adding labels when a sprint is closed.

Navigate to Project Settings: Go to the project where you want to set up the automation.
Automation Rules:
Go to Project Settings > Automation.
Click on Create Rule.
Create a New Rule:
Trigger: Select Sprint Completed as the trigger.
Action: Select Edit Issue.
Edit Labels: In the action configuration, set the label you want to add to the issues in the sprint.
Save and Enable: Save the rule and ensure it is enabled.

Here's a detailed step-by-step:

Trigger: When the sprint is completed.
Condition (optional): Add any conditions you might need.
Action: Edit issues > Add labels.

Using Trello-

For Trello, you can use Butler (Trello’s automation tool):

Open Butler:
Go to your Trello board.
Click on Automation.
Create a New Command:
Choose Calendar or Due Date.
Set the trigger for when a sprint ends (you might need to manually set the end date for sprints).
Add an Action:
Action: Add a label to all cards in the sprint list.
Save Command: Save and enable the automation.

Using GitHub-

If you're using GitHub Projects, you can use GitHub Actions:

Create a Workflow:
In your repository, go to Actions.
Click on New Workflow.
Set Up Trigger:
Use a cron job or a specific event that signifies the end of a sprint.
Define the Action:
Use the actions/labeler GitHub Action to add labels to issues or PRs.

Example Workflow:

yaml

name: Add label when sprint closes

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # This runs every Sunday, adjust as necessary

jobs:
add-label:
runs-on: ubuntu-latest
steps:
- name: Add Label
uses: actions/github-script@v3
with:
script: |
const issues = await github.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'sprint-ending', // Adjust based on how you track sprint end
});
for (const issue of issues.data) {
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ['sprint-closed']
});
}

These steps allow you to automate the process of adding labels when a sprint is closed, ensuring consistency and saving time.

João Ribeiro July 24, 2024

Hi @Julio Herrera 

Thanks for the quick reply. That is what I've tried to achieve but have this warning:

Screenshot 2024-07-24 at 12.54.05.png

Any clue why?

 

Like Julio Herrera likes this
Julio Herrera July 30, 2024

I don't why this error is coming, I will research it and let you know!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events