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

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

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
AUG Leaders

Atlassian Community Events