Hello Jira Community,
I am looking to set up a Jira Cloud automation rule that will help streamline our release process. Here's what I want to achieve:
Thanks in advance!
Hi @Jeff Boon
It is tricky but here is what I'd do to automate the release of a fix version based on the scheduled release date. Since it is not straightforward with Jira Cloud's built-in automation features (afaik there is no direct access to the release date), we can use Jira's REST API within the automation rule.
- Set up the Scheduled Trigger that runs daily at a specified time (e.g., 10:00 AM).
- Add an action choosing "Send web request" to call Jira REST API which retrieves all versions for your project
<span>Method:</span> <span>GET</span> <span>URL:</span> <span>https://your-domain.atlassian.net/rest/api/3/project/{projectKey}/versions</span>
- Add an action "<span>FOR EACH: Add a branch" - Branch rule / related issues</span>
Condition: Inside the branch, add a condition to check if the version's releaseDate equals {{now.minusDays(1).jiraDate}}.
releaseDate
{{now.minusDays(1).jiraDate}}
- Update the Version to be Released
add an action within the branch, "Send web request" action to update the version's status to released.
<span>Content-Type:</span> <span>application/json</span> <span>Body:</span> { <span>"released":</span> <span>true</span>, <span>"releaseDate":</span> <span>"{{now.jiraDate}}"</span> } <span>Method:</span> <span>PUT<br></span><span>URL:</span> <span>https://your-domain.atlassian.net/rest/api/3/version/{{versionId}}<br></span>
<span>Content-Type:</span> <span>application/json</span>
<span>Body:</span> { <span>"released":</span> <span>true</span>, <span>"releaseDate":</span> <span>"{{now.jiraDate}}"</span> }
- Sending release notes (this will be a separate trigger)
- trigger: "Version released"
- Add a "Lookup issues" action with the JQL:
fixVersion = <span>"{{version.name}}"</span>
- add a "Send email" action with the following configurations:
To: enter emails here
Subject: Release Notes for Version {{version.name}}
Release Notes for Version {{version.name}}
Body:
Hello, The version **{{version<span>.name</span>}}** has been released. Here are the issues included in this release: {{<span>#lookupIssues</span>}} - <span>[{{key}}]</span> {{<span>summary</span>}} {{/}} Best regards, Magnificent Team
I hope this helps!
Tuncay
HI @Jeff Boon
for you first question, you can look at this comnunity thread that should explain how this can work via automation
Jira-Automation-How-to-quot-release-quot-a-fixed-version-a-day
The second question should be answered in this post.
How-to-add-Release-Notes-via-Smart-Values-to-an-automated-email
@Bill Sheboy thanks for the provided solutions
Dear @Tuncay Senturk _Snapbytes_ thanks for the detailed step by step, but I am stucked at the Conditioning statement below:Condition: Inside the branch, add a condition to check if the version's releaseDate equals {{now.minusDays(1).jiraDate}}.May I know how do I achieve the above in jira automation?Below is what I've setup for now.
You are correct; I overlooked that part.
Add advanced branching to iterate over the web response.
new action, choose Advanced branching
smart value:
{{webResponse.body.fromJson}}
variable name:
version
then add if condition in which
first value:
{{version.releaseDate}}
condition: equals
second value:
{{now.minusDays(1).format("yyyy-MM-dd")}}
Let me know if I wasn't clear.
btw: I haven't tested it; I just wanted to shed some light on how to achieve this.
Dear @Tuncay Senturk _Snapbytes_ the last action to send web request with PUT method hits an error below:Please enter a valid web request URL
Sorry, have you tested
https://your-domain.atlassian.net/rest/api/3/version/{{version.id}}
Dear @Tuncay Senturk _Snapbytes_ , I believe we are almost there.For the last web request I am hitting below error:405 - Method Not AllowedHow should I proceed?
This is the updating version REST API, isn't it?
405 means that you are using an Http method which is not allowed. In this case it should be PUT (as documented here).
Please make sure that you are using the correct URL and HTTP method.
Hi greetings @Tuncay Senturk _Snapbytes_ , I hope you can help me out on this. I've managed to retrieve all fix versions and managed to PUT all fix versions to release. But I have condition is that I only want to update last week's Wednesday fix versions to Released. But at the moment the condition check is not working, as the automation updates all Unreleased fix version to Released.
It looks like you're new here. Sign in or register to get started.