Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

display sprint status as Ongoing/Not-started/Finished

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

2 comments

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.  

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.

Like # people like this

@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

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

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).

Like # people like this

This format option looks really cool. Thanks for help.

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

384 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you