Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

408 views 23 8
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