User-Select Field in Confluence

Phillip Yero September 16, 2013

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
Answer accepted
Steve Goldberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2013

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2013

Exactly what I would have suggested.

Phillip Yero September 25, 2013

Many thanks.

Robin Roos May 5, 2014

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2013

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

Phillip Yero September 25, 2013

Thanks, I think that'll work.

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 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>

Phillip Yero September 25, 2013

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

Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 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.

Phillip Yero September 26, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events