User-Select Field in Confluence

I am creating a table where others will be inputting information and one of the fields is Status. Now I know Confluence has the Status Macro, but I am looking for something a little more robust that would allow me to limit the choices others have to a list of set stati. This would remove spelling capitolization, and wording errors. I was thinking a drop down user-select field woudl be best, but I'm open to other suggestions.

2 answers

1 accepted

0 votes
Accepted answer

To build on what Davin said. Create a user macro that uses the enum parameter type (see https://confluence.atlassian.com/display/DOC/Guide+to+User+Macro+Templates#GuidetoUserMacroTemplates-Usingparametersinyourusermacro). The call the status macro within that macro and have it set the variable's value based on the enum value.

Davin Studer Community Champion Sep 25, 2013

Exactly what I would have suggested.

Any idea how this could be changed to allow users to alter a status without actually having to EDIT the page?

0 votes
Davin Studer Community Champion Sep 25, 2013

Would a macro that only allows specific choices work? This could be done fairly easy with a user macro.

Thanks, I think that'll work.

Davin Studer Community Champion Sep 25, 2013

Hers is soemthing I whipped up that could work. Just edit the enum values and what the color assignment for those values are and you should be good to go.

Macro Body Processing:
Escaped

Template:
## Macro title: My Status
## Macro has a body: N
## Developed by: Me
## Date created: 09/26/2013
## Installed by: Me
## A specific list of status values.

## @param Status:title=Status|type=enum|enumValues=Good,Mediocre,So-so,Bad,What!|default=auto|desc=Pick a status.

#if ( $paramStatus && $paramStatus == "Good")
#set ( $color = "Green" )
#elseif ( $paramStatus && $paramStatus == "Mediocre")
#set ( $color = "Grey" )
#elseif ( $paramStatus && $paramStatus == "So-so")
#set ( $color = "Yellow" )
#elseif ( $paramStatus && $paramStatus == "Bad")
#set ( $color = "Red" )
#elseif ( $paramStatus && $paramStatus == "What!")
#set ( $color = "Blue" )
#end

<ac:macro ac:name="status">
<ac:parameter ac:name="colour">$!color</ac:parameter>
<ac:parameter ac:name="title">$!paramStatus</ac:parameter>
</ac:macro>

Wow, thank you so much! This is perfect. Would you happen to know how to add the "Use Outline Style" option?

Davin Studer Community Champion Sep 25, 2013

Macro Body Processing:
Escaped

Template:
## Macro title: My Status
## Macro has a body: N
## Developed by: Me
## Date created: 09/26/2013
## Installed by: Me
## A specific list of status values.

## @param Status:title=Status|type=enum|enumValues=Good,Mediocre,So-so,Bad,What!|default=auto|desc=Pick a status.

#if ( $paramStatus && $paramStatus == "Good")
#set ( $color = "Green" )
#elseif ( $paramStatus && $paramStatus == "Mediocre")
#set ( $color = "Grey" )
#elseif ( $paramStatus && $paramStatus == "So-so")
#set ( $color = "Yellow" )
#elseif ( $paramStatus && $paramStatus == "Bad")
#set ( $color = "Red" )
#elseif ( $paramStatus && $paramStatus == "What!")
#set ( $color = "Blue" )
#end

<ac:macro ac:name="status">
<ac:parameter ac:name="colour">$!color</ac:parameter>
<ac:parameter ac:name="title">$!paramStatus</ac:parameter>
<ac:parameter ac:name="subtle">true</ac:parameter>
</ac:macro>

Davin Studer Community Champion Sep 26, 2013

Small edit. The Macro Body Processing should not be Escaped. It should be No macro body. Not sure whay I made that typo.

Yeah, I figured as much so I changed it. Thanks for looking out.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

947 views 13 11
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