Custom drop down list for Statuses

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 Closed
This widget could not be displayed.
Davin Studer Community Champion Mar 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.

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?

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>

 

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

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

Davin Studer Community Champion Mar 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.

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

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. 

This widget could not be displayed.

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?

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.

 

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 Community Champion Jan 03, 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 Community Champion Jan 03, 2018

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

Great job, guys!

Noobies thank you! :)

This widget could not be displayed.

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

This widget could not be displayed.

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. 

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...

481 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