display sprint status as Ongoing/Not-started/Finished

emagnun December 2, 2021

I have my confluence table as below. How do I get to display the sprint's status as Ongoing/Not-started/Finished ? What kind of Jira query that I could use here?

Capture.JPG

8 answers

3 votes
Katerina Kovriga {Stiltsoft}
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.
December 2, 2021

Try this SQL query:

SELECT T1.'Sprint', T1.'Start Date', T1.'End Date',
T1.'To Do'->split(" ")->0 AS 'To Do',
T1.'In Progress'->split(" ")->0 AS 'In Progress',
CAST((T1.'To Do'->split(" ")->0) AS INT) + CAST((T1.'In Progress'->split(" ")->0) AS INT) AS 'Total',
CASE
WHEN DATEDIFF(day, 'Start Date', "today") < 0 AND DATEDIFF(day, 'End Date', "today") < 0
THEN FORMATWIKI("{status:colour=Green|title=Not started}")
WHEN DATEDIFF(day, 'Start Date', "today") >= 0 AND DATEDIFF(day, 'End Date', "today") <= 0
THEN FORMATWIKI("{status:colour=Yellow|title=Ongoing}")
ELSE FORMATWIKI("{status:colour=Grey|title=Finished}")
END AS 'Status'
FROM T*

Thu 5-3.png

You may need to adjust you column names to your original table (this is a test table, not all the column are present).

And set the corresponding date format in the Table Transformer macro settings (mm/dd/yy for this example).

Seems that the conditions work fine (try to check more, but at least you've got an idea how some dates may be compared).

2 votes
Katerina Kovriga {Stiltsoft}
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.
December 2, 2021

Hi @emagnun ,

I can suggest trying to set statuses with the help of the Table Transformer macro.

I guess that this is your table from our previous thread - I suggest leaving the current Table Transformer macro as it is (we already have a rather complex SQL query there with splitting and format changing). So, not to mess anything up wrap the second Table Transformer on the top of the first one (so you'll be working with a result simple table with numbers).

Then you can modify this example to set statuses based on the number of your issues. For example, if To Do and In Progress both are 0, and Done is not, then your sprint is completed.

Maybe this idea could help.

1 vote
Katerina Kovriga {Stiltsoft}
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.
February 10, 2022

Hi there,

As this thread mentions our Table Filter and Charts for Confluence app, we are happy to introduce its new macro – Table Spreadsheet.

The macro allows you to work with fully functional Excel spreadsheets right in Confluence.

You’ll be able to use cells’ formulas, filters, conditional formatting, etc., create pivot tables and charts from the page view and edit mode.

The Table Spreadsheet macro is available for Cloud and Server/Data Center.

1 vote
emagnun December 2, 2021

This format option looks really cool. Thanks for help.

0 votes
emagnun December 2, 2021

Below query helped me to workaround. Not sure if this is the best way.

CASE
WHEN (DATEDIFF(DAY, GETDATE(),T1.'Start Date')>0) THEN "Not-started"
WHEN ((DATEDIFF(DAY, GETDATE(),T1.'Start Date')<0) AND (DATEDIFF(DAY, GETDATE(),T1.'End Date')>0)) THEN "Ongoing"
ELSE "Finished"
END

0 votes
emagnun December 2, 2021

@Katerina Kovriga {Stiltsoft} Thanks for input. I have added a start date and end date columns in my table now.

Capture1.JPG

Is there a way to check today's date against these columns in the below table transformer and then display the status of sprint as not-started/ongoing/finished?

Capture.JPG

Capture1.JPG

0 votes
emagnun December 2, 2021

Thanks @Sebastian Krzewiński .

I have just listed all my sprints one by one in the table. I just want to pass the sprint-name and then get the status of that sprint in the second column. (You can see i'm getting the issue count on other columns by passing the sprint-name)

If you have a suggestion as to how to write such a query, it would help me a lot. Meanwhile I'm going through the links you provided to see if that works out.  

0 votes
Sebastian Krzewiński
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2021

Suggest an answer

Log in or Sign up to answer