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

REST API - Reading pages from a container of a canvas board Edited

Hello there!

I am using the confluence rest api to get a page and then read multiple child pages which are in a container of a canvas board.

The container looks like this:

Container.PNG

The problem is that the container only shows up to 20 elements and then the following is displayed:

<div class=\ "containerfooter\">
<div class=\ "morerows\"> <span class=\ "morecaption\">More</span> <span class=\ "morespinner\"></span> </div>
</div>

I call the rest api with the following url:

WEBSITE:PORT/rest/api/content/ID?expand=body.view

I have tried using other extensions for the body like body.storage but it didn't helped.

 

Has anyone a solution?

 

How to recreate the problem:

1. Create a page

2. Add a canvas board to this page: 

Step2.PNG

Use the "Tasks Canvas" preset

3. Click on the canvas board and go to edit -> properties -> Scroll down to content and select: pages and cards

4. Now publish this page

5. Create a second page which is a child of the page with the canvas board:

Step5.PNG

6. Now go to the page with the canvas board and click on the plus icon of an container and add the child page to this container by writing its title into the textfield

7. You now need to add more child pages to this container so it contains more than 20 

It will look like this:

Step7.PNG

8. Call the REST API with the ID of the page with the canvas board: WEBSITE:PORT/rest/api/content/ID?expand=body.view

-> If you do not find the ID you can go the page -> Click on the three dots -> Page Information -> Find the ID in the url e.g. pageId=123456789

9. The information of a child page in the container should look like this:

<div id=\ "cardid-153059338\" class=\ "boardcontent themedheader \" pageid=\ "153059338\">
<div class=\ "boardcontentwrapper\">
<div class=\ "boardcontentbody\">
<div class=\ "cardactions\">
<button class=\ "aui-button aui-button-compact aui-button-subtle aui-dropdown2-trigger aui-dropdown2-trigger-arrowless\" aria-controls=\ "cardoptions-cardid-153059338\"> <span class=\ "aui-icon aui-icon-small aui-iconfont-arrow-down aui-iconfont-arrow-down-small\">Card Actions</span> </button>
<aui-dropdown-menu id=\ "cardoptions-cardid-153059338\">
<aui-section>
<aui-item-link class=\ "removecard\" data-card=\ "cardid-153059338\"> Remove </aui-item-link>
</aui-section>
</aui-dropdown-menu>
</div>
<div class=\ "cardheading pagecard custom5\"> <a class=\ "pagelink cardtitle\" id=\ "pageid_153059338\" pageid=\ "153059338\" href=\ "/display/QRN/TestPage\" target=\ "_blank\">TestPage</a> </div>
</div>
</div>
</div>
10. You will see that after the 20th page the containerfooter with the caption "More" is displayed

2 answers

1 accepted

0 votes
Answer accepted

I solved the issue now. The problem was the canvas board.

There is a setting "Maximum board rows" which is set default to 20.

When you set this to a higher number it will fix the issue.

0 votes

Hi @Benjamin Schön ,

Just a wild guess but it worked for me when getting the content of a page with a Jira issue macro.  Have you tried to call:

  • WEBSITE:PORT/rest/api/content/ID?expand=body.export_view

 

Can you please test this and let me know if it works?

 

Cheers,
Dario

Hi @Dario Bonotto

thank you for your suggestion! I have tried it but I get the same result as with body.view. The items are still hidden behind the span tag.

 

Best regards,

Benjamin

Hi @Benjamin Schön , 

Not sure I will be able to help here. Anyway, would you mind providing the exact steps I can follow to reproduce the issue and run some tests?

Specifically, what do you mean exactly when you say that you have:

multiple elements which are in a container

Are those macros or anything else? 

 

Cheers,
Dario

Hi @Dario Bonotto ,

I have now updated the question with the steps to recreate the issue so everyone will directly see it.

 

Best regards,

Benjamin

Thanks a lot for updating this thread @Benjamin Schön !

I didn't have had any chance to test this yet and I was going to do it today but apparently it is not needed anymore :) 

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

276 views 9 6
Join discussion

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