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: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
{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:
My next questions will probably be how to then crystallize various returned SQL values within a template sourced from a file...
All assistance appreciated.
Thanks for the pointers, Bob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
Yes, I came up with something that is not exactly the most elegant solution but seems to work. It's quite complex, because it prompts the user to enter and review details about the issue number before they proceed. It also retains JIRA as the source of truth - there is a non-editable section of the release note (defined using a User Macro) that updates according to the details in JIRA.
I've attached the source of the page and the User Macro. Bear in mind that coding is not my gig, so I'm sure it could be improved.
Basically this all uses a combination of the Run, SQL, CLI and replace-and-render macros, a Confluence User Macro, and an XHTML file that contains the template.
The process is:
I found the easiest way to create the XHTML template was to design a page in Confluence and then save the source to the file, replacing certain parts with a placeholder.
What I have learned from this is that, while it's all possible to do, I should learn how to write a script!
(pagesource.txt) (usermacro.txt)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adam:
I am trying to create a similar solution, were you able to finally complete this? If so would you be willing to share the results with me?
Sincerely,
Craig T. Hylwa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.