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

This widget could not be displayed.

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?

This widget could not be displayed.
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 Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

460 views 6 6
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