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

how to grab only the latest blog post

I able to find the lat blogpost using:

 posts = confluence.get_all_pages_from_space( config.atlassianSpace,  content_type='blogpost',  start=0,  limit=99999999, expand='version' )

I've tried changing start, limits to the likes of (-1).

 

Is there an existing method to just get the latest post? 

1 answer

0 votes

Hello Erik,

I'm not sure where you want to display this but if it's in a Confluence page, you can simply use the macro blogpost, display only one blog post and order by creation date. 

Is your use case different? 

Cheers

Thanks!

 

Is that macro and ordering available via the api?

hum am I not an API pro user I have to admit :D 
But I guess by using the command get content, specify the type blog, limit it to one, could work, or using the search command, writing the cql so you specify also the type, limit it to 1 and since it's a cql comment you can order it by last created, i think it should work even better. 

https://docs.atlassian.com/ConfluenceServer/rest/7.1.0/#api/content-search

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...

327 views 9 7
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