To track our next app release, I used Jira’s Releases Overview data stream in SquaredUp. I scoped it to my project, filtered for unreleased versions, sorted by start date, and grabbed just the first result - the next release.
Tracking how many days are left
Now that I had the next release identified, I wanted a way to track how much time was left, not just the date, but in No of days. To do that, I added a Custom column in SquaredUp.
Here’s how to do it:
- Go to the Columns section
- Click + Add, then choose Custom
- Name it and set the Type to Number
In the Value Expression, I used the below expression to calculate the number of days remaining based on the releaseDate
:
{{
(() => {
const today = new Date();
const release = new Date($['releaseDate']);
let count = 0;
for (let d = new Date(today); d <= release; d.setDate(d.getDate() + 1)) {
if (d.getDay() !== 0 && d.getDay() !== 6) count++; // exclude weekends
}
return count; // return no. of working days
})()
}}
It returns the number of remaining work days, with weekends excluded.
Showing a state (success/warning/error)
I also wanted to show a visual state based on how close we are to release. Something like:
- error if 10 days or less
- warning if 20 days or less
- success otherwise
For this, I set the Custom column’s Type to State and used the below expression:
{{
(() => {
const today = new Date();
const release = new Date($['releaseDate']);
let count = 0;
for (let d = new Date(today); d <= release; d.setDate(d.getDate() + 1)) {
if (d.getDay() !== 0 && d.getDay() !== 6) count++; // exclude weekends
}
if (count <= 10) return 'error';
if (count <= 20) return 'warning';
return 'success';
})()
}}
And that’s it, now I have a clear countdown showing the exact days left, plus a State view that highlights how close the release is.