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
4,297,597
Community Members
 
Community Events
165
Community Groups

REST API order of items in ancestors for various object types

Experimentally, I am finding that for comments, the first item in the ancestors array in the response is the direct parent, but for pages, the last item in the ancestors array is the direct parent.

The API does not document the order of items in the ancestors array, so I don't know whether I am supposed to be able to rely on the order of ancestors at all. It would be nice if the API documentation can be updated to made that clear.

Of course, if the ancestors array is currently not in any guaranteed order, it would be nice if that could be changed so that the order is meaningful and is the same for all object types.

1 answer

0 votes
Leonardo H Atlassian Team Jun 23, 2022

Hello @Steve Jorgensen ,

Thanks for submitting your question to our community!

I understand that you have observed some interesting lack of pattern/standardization when retrieving information from your account over the API.

More specifically, you have found that different objects return results in different ordering, as outlined in the examples below:

  • When retrieving comments, the first item in the ancestors array is the direct parent
  • When retrieving pages, however, the last item is the direct parent

I'd be happy to try finding some more clarification on that for you. In order to do so, could you please share some examples of calls (endpoints and request params) you have used, to make sure we are aligned in terms of context?

  • Please make sure that you do not include any sensitive information about the calls.

We appreciate your feedback in advance!

Best regards,

Leonardo H 

I have been swamped, but I do intend to provide the examples you have asked for soon.

By the way, the inconsistency is by far the lesser of my concerns as I recognize that people may have come to rely on the current behaviors in both cases. Having an official and documented way to determine the ancestor sequence in the desired direction would be most helpful though.

Leonardo H Atlassian Team Jun 27, 2022

Hey @Steve Jorgensen

 

No worries at all, I know how busy we get very often. Happy to analyze this further once I have some more context about these differences and take that feedback forward to the team!

Suggest an answer

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

Presenter Mode for Confluence is here 🖥 👩‍💻

👋  Hello Community!  My name is Stephanie Zhang, and I’m a product manager on the Confluence cloud team. Today, I’m excited to announce the rollout of  Presenter Mode : a ...

80,570 views 127 304
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