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

1 vote
Accepted answer

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 Oct 24, 2018 in Confluence

Atlassian Research opportunity with Confluence templates

Do you use templates with Confluence? Take part in a remote 1-hr workshop. You'll receive USD $100 for your time!   We're looking for people to participate in a   remote 1-hr workshop...

1,056 views 16 14
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