Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

User Macro with no color lozenge or uses outline border instead

Jerri Knipstein April 16, 2019

I need a user macro with no color lozenge or uses white background with border. Can anyone assist?  I really need to use a custom macro to list various Project Status but don't want to use the color lozenge.  I found previous code on the internet that works, but has the color lozenge.  Below is the code I found, but is there a way to use this macro without any color?  Or can I have it with the outline style (subtle)?  

I am also testing using Easy Dropdown menu, but would prefer a macro if possible. 

## Developed by: Davin Studer
## Date created: 03/19/2014
## @Param Status:title=Status|type=enum|required=true|enumValues=Inactive, Active, On Hold, Complete, Cancelled|desc=Choose a status.

#if ( $paramStatus == "Active" )
#set ( $color = "Green" )
#elseif ( $paramStatus == "On Hold" )
#set ( $color = "Yellow" )
#elseif ( $paramStatus == "Cancelled" )
#set ( $color = "Red" )
#elseif ( $paramStatus == "Complete" )
#set ( $color = "Blue" )
#elseif ( $paramStatus == "Inactive" )
#set ( $color = "Gray" )
#else
#set ( $color = "Gray" )
#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

1 accepted

0 votes
Answer accepted
Bill Bailey
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.
April 17, 2019

The example you have uses the status macro. You just need to add the following parameter

<ac:parameter ac:name="subtle">true</ac:parameter>

For example:

<ac:structured-macro ac:name="status" ac:schema-version="1">
<ac:parameter ac:name="subtle">true</ac:parameter>
<ac:parameter ac:name="colour">Yellow</ac:parameter>
<ac:parameter ac:name="title">On Hold</ac:parameter>
</ac:structured-macro>

 

For another version of this type of wrapper macro (with more details), take a look at my article:

Getting-Started-with-User-Macros-Writing-a-Wrapper-Macro

Jerri Knipstein April 18, 2019

Bill Bailey - Thank you for the quick reply and the assistance.  I also ready the link you provided which is also very informative.  Thanks again!  

Bill Bailey
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.
April 18, 2019

You're welcome. Do me a favor and accept the answer?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events