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?
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*
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).
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Katerina Kovriga {Stiltsoft} Thanks for input. I have added a start date and end date columns in my table now.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @emagnun
In JQL you have 3 functions to filter on sprints statuses:
- futureSprints() - https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-futureSprintsfutureSprints--
- closedSprints() - https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-closedSprintsclosedSprints--
- openSprints() - https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-openSprintsopenSprints--
Please check if this will help you.
Regards,
Seba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.