Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get confluence page source HTML using scriptrunner

Dar Kronenblum
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.
May 14, 2017

Hi

I configured some drop down list on the confluence page and I would like to get the selected items in a script macro.

I tried to use page.getBodyAsString() function in order to get the selected options but it seems like this data doesn't appear in the result string

I wonder if there is a way to get the raw HTML of the page in order to get the selected data

thanks

Dar

 

1 answer

0 votes
AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2017

You may view the XHTML storage format at the ellipsis on the top right "view storage format". Is this the raw data you are looking for?

Screen Shot 2017-05-23 at 11.30.05 AM.png

Dar Kronenblum
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.
May 23, 2017

Thanks Ann!

I configured a drop dowm list macro in the page and the XHTML storage format don't show the selected item in this list (only the available options)

I wonder if there is a way to get this information 

thanks

Dar

 

Dario July 6, 2023

Hi @Dar Kronenblum

I would like as well to get XHTML code from Confluence's page body. I need to create Heading tags using panel title as title inside them in order to be recognized from Table of Contents.

Do you know how to get the XHTML code using groovy script? In addition, once I get the XHTML code, do you know how to do the modification metioned?

Thank you in advance.

Dario

Nic Brough -Adaptavist-
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.
July 6, 2023

If you do that, you will break the storage format - Confluence may not be able to work with the page at all any more.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events