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

Using sql plugin inside user macro

Bruce Schlueter April 24, 2013

Hi,

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
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
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 25, 2013

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 ...

Bruce Schlueter April 25, 2013

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.

Bob Swift OSS (Bob Swift Atlassian Apps)
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 25, 2013

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.

Bruce Schlueter April 25, 2013

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
TAGS
AUG Leaders

Atlassian Community Events