• Community
  • Products
  • Confluence
  • Questions
  • I am trying to make status macro display different titles based on the color selected. e.g. red="Blocked", green="progressing well". Is that possible?

I am trying to make status macro display different titles based on the color selected. e.g. red="Blocked", green="progressing well". Is that possible?

Thank you.

3 answers

0 vote
Stephen Deutsch Community Champion Mar 11, 2016

Hi Maxim,

Here's a small user macro that should do what you're asking

## @param Selection:title=Selection|type=enum|required=true|enumValues=Grey,Red,Yellow,Green,Blue
#if ( $paramSelection == "Grey" )
  #set ( $colour = "Grey")
  #set ( $text = "Grey text" )
#elseif ( $paramSelection == "Red" )
  #set ( $colour = "Red")
  #set ( $text = "Red text" )
#elseif ( $paramSelection == "Yellow" )
  #set ( $colour = "Yellow")
  #set ( $text = "Yellow text" )
#elseif ( $paramSelection == "Green" )
  #set ( $colour = "Green")
  #set ( $text = "Green text" )
#elseif ( $paramSelection == "Blue" )
  #set ( $colour = "Blue")
  #set ( $text = "Blue text" )  
#end
  
<ac:structured-macro ac:name="status">
    <ac:parameter ac:name="colour">$colour</ac:parameter>
    <ac:parameter ac:name="title">$text</ac:parameter>
</ac:structured-macro>

You can change the name of the selections (in the enumValues on the first line), and then just change the name also in the if statements.

You then substitute the text that you want each color to display where it says "<colour> text".

Note that by using a user macro, you lose the ability to choose the color directly from the editor menu.

There is a way without coding. You can try a Handy Status macro from the Handy Macros for Confluence add-on.

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
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

345 views 20 10
Join discussion

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