Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Get macro body from page through groovy

Deleted user Feb 27, 2019

Hi everyone,

i'm search a method to get the bodycontent of an macro that are inside of an given page.

import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.pages.PageManager
import com.atlassian.confluence.core.BodyContent
import org.apache.log4j.Logger;
import org.apache.log4j.Level;
import com.atlassian.confluence.renderer.UserMacroLibrary

def pageMangaer = ComponentLocator.getComponent(PageManager)
def bodyContent = ComponentLocator.getComponent(BodyContent)
def userMacroLibrary = ComponentLocator.getComponent(UserMacroLibrary)
def macro = userMacroLibrary.getMacro("include-section")
def page = pageMangaer.getPage("space","Ricardo da Silvas Startseite")

this is what i got right now, but i'm looking for a method to get the body content of the used macro in that page.

I hope someone can help me with this.



1 answer

1 accepted

0 votes
Answer accepted
Deleted user Feb 28, 2019

Duplicate can be close due this was market as Spam

where is the original?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

788 views 5 21
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