Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Custom drop down list for Statuses

Thomas Hardin March 19, 2014

I would like to create a custom drop down list that provides users with a particualr status of a work request. We have several pre-defined statuses that a work request will go through from inception until completion.

The status macro isn't very helpful since you have to edit, select a color and add text. so, my thought is to use a table field where I could insert a cool drop down list with button type indicators with preset text. Example: when a work request has been submitted by a customer, the status is, EDS1. When it goes into tech review, it is changed to REVW. wen it goes into construction, it goes into WORK.

So I'd like to be able to change the status, or have a user change the status when necessary. And to add some flash, I'd like to each one have a color coded button of sorts.

Any ideas? I thought the use of buttons would make things easy since there are so many button generators out there.

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

9 votes
Answer accepted
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.
March 19, 2014

You could create a user macro that has a parameter with a predefined set of values that would then populate a status macro's text and color depending upon which value is selected in the user macro parameter.

Thomas Hardin March 19, 2014

As a very new and very green user, is there an easy to follow path to doing this? I've seen a lot of html samples, so my guess is to modify those and then implement them into the 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.
March 19, 2014

Here is an example of a user macro. These must be created by a system admin.

Macro Name:
work-request-status

Macro Title:
Work Request Status

Macro Body Processing:
No macro body

Template:

## Developed by: Davin Studer
## Date created: 03/19/2014

## @param Status:title=Status|type=enum|required=true|enumValues=EDS1,REVW,WORK|desc=Choose a status.

#if ( $paramStatus == "EDS1" )
#set ( $color = "Yellow" )
#elseif ( $paramStatus == "REVW" )
#set ( $color = "Blue" )
#elseif ( $paramStatus == "WORK" )
#set ( $color = "Green" )
#else
#set ( $color = "Yellow" )
#end

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

 

Like Robin_Streiter likes this
Thomas Hardin March 19, 2014

Thank you very much Davin! You've been a big help.

Thomas Hardin March 19, 2014

So, for each status type, I can continue to add colors. Could I use a CSS class instead of the color?

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.
March 19, 2014

This example uses the built in status maco ... which only has five colors. If you need more than that you would need to build out your own status indicator with html. You could use css. In the user macro if you replace the macro xml with html and add in a <style> block you could make it look the way you want. I just figured I would show it to you with the status macro as it is built into the system and would thus follow the system's UI guidlines. User macro's are super handy. They give you the ability to do some somewhat powerful things without having to drop down to programming a full on plugin in Java.

Per Löfgren (Qlik) April 1, 2014

Thanks David! This was exactly what I was looking for but I couldnt get it to work at first. All that was wrong though was that it needed a space in the beginning of the macro when defining the parameter. Probably just a formatting error when doing a copy paste to the editor

## @param Status:title=Status

Axel Holene June 20, 2017

The suggested approach does indeed work, but you still have to first edit the page and then edit the status macro to change status. As far as I am concerned, this is no real "drop down status list".

Is it possible to achieve a proper drop down status list without having to buy add-ons? I'm on a customers system, and can't go installing add-ons as it suits me. 

0 votes
Florian Zöllner [Communardo] June 20, 2017

I'd go with an Marketplace Add-on solution. You could either use the Comala Workflows Add-on for review processes of pages or simple use the Metadata for Confluence Add-on to add custom (e.g. dropdown) fields to pages.

Of cause you can get a filtered list of all pages with xyz-status with both tools. 

0 votes
Andrey Khaneev _StiltSoft_
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.
June 20, 2017

Handy Status macro (Handy Macros add-on) does exactly what you want.

0 votes
Thomas Hardin March 19, 2014

As a very new and very green user, is there an easy to follow path to doing this? I've seen a lot of html samples, so my guess is to modify those and then implement them into the macro?

d h April 8, 2016

I just came across this post and this is what I did... version 5.8.10.

Log into Confluence as an Admin.

Click on the gear at the top and click on Geneeral Configuration.

In the left menu box, click on User Macros -> Create a New User Macro.

 

Macro Name:   work-request-status
Visibility: Visible to all users in the Macro Browser
Macro Title: Test Case Status
Description: Test Case Status for reporting.
Categories: Confluence Content
Macro Body Processing:  Unrendered
Template:
## Developed by: Me
## Date created: 2016-04-07

##
 @param Status:title=Status|type=enum|required=true|enumValues=NOT 
STARTED,IN PROGRESS,PASS,FAIL,BLOCKED|desc=Test Case Status.

#if ( $paramStatus == "NOT STARTED" )
#set ( $color = "Grey" )

#elseif ( $paramStatus == "IN PROGRESS" )
#set ( $color = "Yellow" )

#elseif ( $paramStatus == "PASS" )
#set ( $color = "Green" )

#elseif ( $paramStatus == "FAIL" )
#set ( $color = "Red" )

#elseif ( $paramStatus == "BLOCKED" )
#set ( $color = "Red" )

#else
#set ( $color = "Grey" )
#end

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

 

 

Then save.  After saving, you can go create a new page and insert macro.

 

Jennifer Iwata January 3, 2018

I've used this in the past and it's worked, but I'm on a new instance and getting this error: "Error occurred rendering template content"

 

Any thoughts on how to resolve the error?

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.
January 3, 2018

If you used the above code as-is from "d h" then that is why. When Atlassian migrated their content off the old Answers site to this new site almost all of the code snippets got borked. You need to replace &lt; with < and &gt; with >.

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.
January 3, 2018

I've fixed the above code to remove the escaped xml characters.

tifonas-katrina March 12, 2018

Great job, guys!

Noobies thank you! :)

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events