Forums

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

Custom Confluence user macro not working

Kim Van Slooten
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2019

I have created 2 custom user macros, one works and the other does not. It gives the error of Unknown macro. I would appreciate any help with figuring out the issue.

Below is the user macro that works:

## @Param Status:title=StatusColor|type=enum|enumValues=New Request,In Progress,Completed|required=true|desc=Choose a status.

#if ( $paramStatus == "New Request" )
#set ( $paramColor = "Yellow" )
#elseif ( $paramStatus == "In Progress" )
#set ( $paramColor = "Blue" )
#elseif ( $paramStatus == "Completed" )
#set ( $paramColor = "Green" )
#else
#set ( $paramColor = "Yellow" )
#end

<ac:structured-macro ac:name="status">
<ac:parameter ac:name="color">$paramColor</ac:parameter>
<ac:parameter ac:name="title">$paramStatus</ac:parameter>
</ac:macro>

Below is the user macro that is throwing the error:

## @Param Urgency:title=UrgencyColor|type=enum|enumValues=High,Medium,Low|required=true|desc=Choose an urgency.

#if ( $paramUrgency == "High" )
#set ( $paramColor = "Red" )
#elseif ( $paramUrgency == "Medium" )
#set ( $paramColor = "Orange" )
#elseif ( $paramUrgency == "Low" )
#set ( $paramColor = "Yellow" )
#else
#set ( $paramColor = "Yellow" )
#end

<ac:structured-macro ac:name="urgency">
<ac:parameter ac:name="color">$paramColor</ac:parameter>
<ac:parameter ac:name="title">$paramUrgency</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.
January 25, 2019

OK, I am going to ask a stupid question. What is the urgency macro? I am aware of the status macro. I am guessing you need to change

<ac:structured-macro ac:name="urgency">

to

<ac:structured-macro ac:name="status">

Also, take a look at my recent article. You may get some new ideas, mainly on avoid the if-elseif tree. Also, it specifically involves the status macro. It is located here: Getting Started with User Macros - Writing a Wrapper Macro

Kim Van Slooten
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 28, 2019

Not a stupid question at all. My first attempt at writing a macro by copying another. Thanks for pointing me the right direction. 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, knowledge sharing, intentional knowledge sharing playbook, loom, confluence, team collaboration, knowledge management, workplace productivity, information silos, documentation best practices, internal communication, knowledge sharing strategies

Conquer collaboration chaos with Loom + Confluence

You don't need more tools. You need tools that actually work together – the way humans do. See how Loom + Confluence help teams collaborate with more context, more connection, and fewer calendar invites. 💪

See inside
AUG Leaders

Atlassian Community Events