Pull data from SQL query, display with conditional formatting in Confluence

Our overall end goal is to create decent looking project status pages in Confluence, including data from Confluence and JIRA. The former is internal-only and allows guest access; the latter is more public and locked down.

What I'm trying to specifically figure out is conditional formatting of data. Let's say that through a SQL query, we calculate a value that corresponds to a status. When displayed, that status field should then be styled visually based on its value (with colors, images, lozenges, etc.).

Some of the values will come directly from JIRA; some will be custom calculations for each status page. As an example, the simplest custom display would be the stoplight format (red, yellow, green).

I know that I can write a plugin to do this, but it seems to me that this is something that Confluence can already do, and I'm just not aware of it.

 

tl;dr: I want to get data from outside of confluence, change the way it's displayed based on various criteria, and have it be dynamic

2 answers

1 accepted

That is a pretty typical use case for the SQL-query Macro from SQL for Confluence. Suggest using wiki for the output format so you can easily use wiki markup in your SQL select statements to do customized coloring or user the status macro for instance. Usually the SQL case statement is used for that.

Yep - turns out I was making this way more complicated than it needed to be!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published 14 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

99 views 2 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you