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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner wrriting macros for Confluence

Hi,

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:

<p>
<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>
</ac:structured-macro>
</p>
<p>
<br/>
</p>

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

Hi @Ivica Vančina

Have you tried to escape the label string like this:

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

Regards

Lasse Langhorn

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Trello

📹 What is a Trello board?

Hi, Atlassian Community! My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. I'll be sharing with you a series of videos with my top tips on how to best use Tre...

0 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you