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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I use JS to create a dynamic dropdown to select a list of statuses

Hi all, I'd like to add a dropdown that will allow users to select from a list of predefined status types.  I do not have access to create user macros so I was wondering if there's a way to use the HTML macro and add some JavaScript (maybe leverage Ajax) to define the various status types and colors and then pass that to the status macro to display.

I did find a solution to do this using a user macro but since I have no access to that, I was wondering if anyone can give me the JS alternative that I can add to an HTML include. 

I've added the user macro code below.

Thank you all very much for the help:

 

##
 @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>

 

1 answer

Hi @Nicky ,

I can suggest using one of our apps - Handy Macros for Confluence.

The add-on provides the Handy Status macro that fully accomplishes your case: you create pre-defined sets of statuses and switch them in the page view mode.

Besides you'll be able to use Handy Dates - clever datepickers that allow you to change dates also on the fly without going to the page edit mode.

I appreciate the answer but I need a solution that will work with an HTML macro.  I do not have the ability to add new macros.

Thanks again.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

177 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you