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

Confluence RUN / CLI / SQL: Pass generated variables to each other

Daniela Scheiwe
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 9, 2013

Hi,

It's complicated to explain, to put it short, I want to:

Get user generated values with RUN, get a result from a DB query with these, use that result and the other values with CLI. Problem is, I don't know how to "store" the result of the query for further usage in CLI.

Long version:

I'm currently building a user input mask for creating new projects using the run & cli-plugins in combination with the sql plugin.

Setup:

Run-Form asks for customer key and some other data, upon "run" an sql query gets the customer name from another database. Thats works.

Then I'm using CLI to add the space, space key is the customer key, space title should be the customer name that is fetched from the external database, but I can't get that working.

If I directly enter the sql query macro as a value for the space title in the CLI command, the spaces title will be {sql-query}myquery{sql-query}.

When I execute the query before the CLI-macro I get the value, but I have no idea how to get that result of my sql-query passed onto the cli macro.

I also tried nested runs with a replace-value = my sql query, but that totally messes up the macro.

Any help is appreciated!

1 answer

1 accepted

0 votes
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.
January 10, 2013

I would usually go to a little scripting for complex cases, you can gets some hints from How to generate choice values using SQL . In some cases you can get away with replace and render type logic to like How to generate choice values using replace and render . If you need more help, I would need more time to look at all the details - open a support issue.

Daniela Scheiwe
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 10, 2013

Thanks Bob, I will give that a try. If I dont get this working, is it possible to change the space title with cli? I could create the space and rename it later then. Haven't found any option to update a space...

Daniela Scheiwe
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 10, 2013

Just gave it a try (never used replace and render before), it worked instantly. Thanks a lot!!

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.
January 10, 2013

There is not a remote API to update the space title or description :(. The CLI would have to use some other techniques to provide that. Open an issue if it is important.

Daniela Scheiwe
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 10, 2013

Thanks for your feedback. As I managed to set the space title upon creation now I don't need to rename. But one last question - is it possible to define the space homepage with CLI 2.5? I first create the space, then copy some pages and then I want to set one of these pages as the space homepage.

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.
January 10, 2013

I think that came in a later release at least that is what the doc archive 2.5.0 indicates.

Daniela Scheiwe
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 29, 2013

Might be helpful for others:

Solved by saving my new homepage with the same title as the old home page with replace paramater :)

Bob, in general: A big thanks for your great plugins!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events