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

Scriptrunner wrriting macros for Confluence

Ivica Vančina June 18, 2020


I need a help with xml part of my script that I use to automatically make Confluence page when a Jira issue is created.

I am using Scriptrunner for Jira Listener.

Here is my code for macro that is working:

xml.'ac:structured-macro'('ac:name': "panel") {
'ac:parameter'('ac:name': "borderStyle", "solid")    
'ac:parameter'('ac:name': "rich-text-body", "TextField")

But when I want to run for example macro to make a content lablel I don't know how to make it work.

Here is source code that makes Confluence when I write macro directly on Confluence page:

<ac:structured-macro ac:macro-id="cc35373a-d1f9-4dc4-8ecd-5f289c179b5b" ac:name="contentbylabel" ac:schema-version="3">
<ac:parameter ac:name="cql">label = "ivica"</ac:parameter>

So the problem is when I put this part of code label = "ivica" in  scriptrunner. Then he gives error that variable is not defined. I tried different solutions with qutation mark but it doesn't work. 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Lasse Langhorn
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.
June 20, 2020

Hi @Ivica Vančina

Have you tried to escape the label string like this:

'ac:parameter'('ac:name': "cql", "label = \"ivica\"")


Lasse Langhorn

AUG Leaders

Atlassian Community Events