Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting PageId from a Confluence Search result

Normann P_ Nielsen _Netic_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2023 edited

Refering to : 

 

https://developer.atlassian.com/server/confluence/searching-using-the-v2-search-api/

 

Using

 

searchResults.each { thePage ->

 

          pageId = thePage.getIdAsString()

          pageName = thePage.getDisplayTitle()

 

---------

How do I get Page Id - I have tried:

 

.getId()

.getPageId()

.getEntityId()

.getIdAsString()

 

.getFieldValue("pageId")

.getFieldValue("Id")

 

No luck....

 

There no clue (for me) at https://docs.atlassian.com/atlassian-confluence/6.2.1/com/atlassian/confluence/search/v2/SearchResult.html

1 answer

1 accepted

1 vote
Answer accepted
Normann P_ Nielsen _Netic_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2023 edited

I found the answer here:

 

https://moduscreate.com/blog/confluence-scriptrunner-and-impersonation/

 

pageId = thePage.handle.id

 

or

 

pageId = thePage.getHandle().getId()

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, compass learning path, get the most out of compass, internal developer platform, devex learning path, atlassian learning, transparent architecture, component catalog, improve dev experience, compass platform training

Elevate your skills and enroll in the Compass learning path today! 💻

This learning path offers short, self-paced courses to help software teams systematically manage components and services. Compass provides a unified interface for tracking distributed software architecture and team collaboration.

Learn more!
AUG Leaders

Atlassian Community Events