Hi All,
I am creating a page in confluence with User Template using confluence REST END point.
In the Template I created one Template Variable called "$issuekey".
I want to pass jira issuekey value to the $issuekey".
Currently I am doing using the following line of code
NewParentPage.setBodyAsString(tamplateAsString.replaceAll("issuekey","${issue.key}"))
I am replacing the variable with issuekey value.
is there any way to set the variable value in confluence?
Also I tried with below code
def pageTemplate = pageTemplateManager.getPageTemplate(params.tamplateid as Long)
String tamplateAsString = pageTemplate.getContent()
String issuekey = params.key
List<Variable> tempvar = pageTemplateManager.getTemplateVariables(pageTemplate)
log.debug("Number of variables in template"+tempvar)
tempvar.each { t ->
t.setValue(issuekey)
log.debug("Value of variable before"+t.getValue().toString())
}
I am able to set the value with the above code.But unfortunately while creation of the page the value is displaying in the created page.
Please help to resolve this