Hi, first up I'll qualify my ignorance by saying that I'm not a developer but, hey, at least I'm trying!
I've been tinkering with our newly acquired Run and SQL macros with the aim of achieving the following page-creation scenario, similar to the example provided on this Plugin wiki page:
1) Retrieve JIRA issue Summary field to screen via SQL plugin, for user verification
- Run macro passes the JIRA reference supplied by the user into the query:
{run:id=ref|replace=ref:TC-:Reference:text-required|titleRun=Retrieve}
|*Title*|{sql-query:dataSource=JIRADB|output=wiki|table=false}
select Summary from jiraissue where pkey='$ref'
{sql-query}
2) Display Summary on screen and offer to create page from template
- Run1 macro is nested within Run macro runs a CLI command like:
@{cli:profile=confluence|showcommand=true|panel=true}-a addPage --space CONF --parent @home --title $... --file templates\\test.txt --noConvert --labels test1,test2 --replace{cli}
Page created: [$...]
My questions are:
- The value initially stored in $ref doesn't seem available to the second Run1 macro because the page is refreshed. Can I keep it persistent?
- How could I turn the value returned by SQL (the JIRA Summary) on the first run (Run) into a variable passed to the CLI title parameter on the second run (Run1)?
- Do I need to investigate doing this using a Groovy script instead?
My next questions will probably be how to then crystallize various returned SQL values within a template sourced from a file...
All assistance appreciated.