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

Calling an application within a user macro?

mcginty_dom November 20, 2020

Hey everyone,

I am trying to use an application called "Database Connector" which uses SQL to create tables within confluence. However, when I try to call the database-query macro within a user macro it does not recognize the name despite being able to use this within a page to call the macro. Example macro below:

## example (works for panel macro)
$action.getHelper().renderConfluenceMacro("{panel:title=Title|borderStyle=none|bgColor=#f3f3f3} paragraph {panel}")

## example (fails for database connector macro)
$action.getHelper().renderConfluenceMacro("{database-query-compact:profile=LLInstallations|sql=$query}")

 

The error message I receive is:

error.png

The purpose of this is the application does not accept parameters or output wiki markup correctly, so I am looking for a free alternative to do this. Thanks for reading and any help would be greatly appreciated!

1 answer

0 votes
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.
November 20, 2020

If I remember correctly, the renderConfluenceMacro method only worked for older style macros which supported wiki markup for entry. There is no equivalent for the newer style macros.

What you CAN do is create a wrapper macro that includes and configures the macro you want using its storage format version.

I wrote an article on how do to do this: Getting Started with User Macros - Writing a Wrapper Macro 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events