Using sql plugin inside user macro


I am looking for a way to reuse the result from the sql plugin inside a user macro. What I actually want to do is to create a table that contains the titles of the last edited pages from a space.

The result I receive via sql plugin. Now I want to create links underneath the title so that if you click onto the title inside the table you will be switched to that page. I thought this might be possible with a usermacro. Any help is apreciated.

Thanks, Bruce

1 answer

1 accepted

Just use wiki markup for linking as the output of your column data. Set the output format for the macro to be wiki.

select '[' || title || ']' from ...

thanks for your response but that does not solve my problem. I did find that hint in the reporting documentation, but this leads to a table filled with "0" instead of the title. If I just add the query to the page it works fine but has no links to the page. Am I missing anything? We are running Confluence 4.3.2 against a MySQL.

This is pretty standard usage scenario. With MySQL you probably need to use the concat function, but it virtually the same. I need more details to see what you are doing. Open an issue if you have more difficulties and provide your SQL.

Thanks, I got it now. Reading is one thing understanding correct another :-(

For those who are unable to see it directly in MySQL the query should look like this

select title AS Titel,concat("[",contentid,"@easypage","]") as Link from vw_newest_pages_easywiki

You need to add the square brackets inside the "concat"

Anyway, thanks for your hint to head me into the right direction

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,232 views 83 8
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