Confluence 5.8.5 Tree View not showing hierarchy
Asked by gregjm:

We recently installed Confluence 5.8.5 and imported (using REST API) several pages. The pages are showing up as expected. However, when we try to view the pages in the Tree View (pages/listpages-dirview.action?key=testSpace) the pages don't show up and the list is blank. Any idea why this is happening?

Thanks.


Answers:
author: gregjm
body: Thanks Steven for the details!

I'm actually already setting the 'ancestors' as you mention when doing the REST import. In fact I posted my findings on this about three months ago here in the comments section:

<https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples>

...so the hierarchy is being set on import.

For some reason the "Reorder pages" view is coming up blank (even though the pages exist in the hierarchy).

I'm also seeing this if I create a new space with the "Documentation Space" option...for some reason the example pages created for the vanilla space don't show up in the Tree View...hmmm - not sure what would be causing this.

Thanks again for the info!

comments: author: Steven F Behnke
body: Haha Greg, I just quoted your own dang comment right back at you. :3I'm definitely curious about this problem...


author: Marinus van Aswegen
body: Any progress Greg ? I have a similar problem.


author: Steven F Behnke
body: This is a fairly common problem. If you didn't specify an "ancestor" when you imported the pages, they will be at the root of the space. The sidebar is looking for "descendants" of the page you're on RIGHT NOW, which I can surmise is the Space Home page.

1. Click the image2015-8-14 13:33:4.png button in the sidebar
2. Select **Reorder pages**   
   image2015-8-14 13:33:50.png
3. You will likely note that instead of being UNDER the homepage, these pages are simply at the root of the space. As I noted above, the sidebar's behavior is to show the Pages under the page you're on. Since the page "print" isn't under ++Behnke Home++ , I will not see them on the sidebar when I am on the page ++Behnke Home.++   
   image2015-8-14 13:35:22.png
4. To fix this, you can use the **Reorder pages** function to drag'n'drop all the pages necessary where they belong.

You can avoid this issue by specifying which piece of content this newly created page belongs under as you import it. You would need to declare this like so:

```
"ancestors": [{        "type":"page",        "id":PARENTID}]
```

This function is the same for adding comments to pages, so that you can add threaded comments to pages using the same method.

```
{    "type": "page",    "ancestors":?[{        "type":"page",        "id":PARENTID    }],    "title": "TITLE",    "space": {        "key": "SPACEKEY"    },    "body": {        "storage": {            "value": "BODY CONTENT",            "representation": "storage"        }    }}
```

[Confluence REST API: REST API Examples](https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples#comment-2023256366)  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-5-8-5-Tree-View-not-showing-hierarchy/qaq-p/103520?attachment-id=11291){#link_118814eba7ed71}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/17327/1/image2015-8-14%2013%3A35%3A22.png){#display_118814eba7ed71_0}  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-5-8-5-Tree-View-not-showing-hierarchy/qaq-p/103520?attachment-id=11292){#link_118814eba7ed71_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/17327/2/image2015-8-14%2013%3A33%3A50.png){#display_118814eba7ed71_2}  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-5-8-5-Tree-View-not-showing-hierarchy/qaq-p/103520?attachment-id=11293){#link_118814eba7ed71_1}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/17327/3/image2015-8-14%2013%3A33%3A4.png){#display_118814eba7ed71_4}  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-5-8-5-Tree-View-not-showing-hierarchy/qaq-p/103520?attachment-id=11294){#link_118814eba7ed71_2}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/17327/4/image2015-8-14%2013%3A32%3A0.png){#display_118814eba7ed71_6}


author: gregjm
body: Thanks Luiz - I just rebuilt the index and the Tree View still does not show up. The "Recently Updated" shows up fine and the "Alphabetical" list is also fine...just the Tree View is blank. We also recently installed Confluence 5.7.3 and this had no issues with the Tree View - we are basically doing the same thing as before except this time we are using 5.8.5


author: Luiz Maia
body: Hi Greg,

As you've imported those pages using Rest API, I suspect Confluence might not have indexed the content.

I'd suggest as first step you perform a [rebuild of the content index](https://confluence.atlassian.com/display/DOC/Content+Index+Administration).

Please let us know how it goes.

Thanks!

Kind regards,

Luiz Maia  
Atlassian Support


Tags: confluence-administration