Community moderators have prevented the ability to post new answers.
I'm not sure if you're asking for how to get it via a plugin, or just in general. This user macro will allow you to get it by using the page-info macro.
## ----------------------------------------------------
## Macro title: pageid_edit
## Macro has a body: No
## Body processing: Use unprocessed macro body
## Output: Generates Wiki Markup
##
## This macro displays a View Page and Edit Page link
## for the space/page you specify. (These URL forms require
## a pageid, so this macro determines the pageid from the space/page.)
## Useful when a page won't display, or when you need to view or edit
## a large volume of pages (such as when you have a list of pages in
## a text file or Excel spreadsheet).
##
## Params:
## space: the space key
## page: the page title
## ----------------------------------------------------
#set ($wikibaseurl = "$action.getGlobalSettings().getBaseUrl()")
#if ($paramspace)
#set ($spacekey=${paramspace})
#end
#if ($parampage)
#set ($page=${parampage})
#end
#set ($pageid="{page-info:pageId|page=$spacekey:$page}")
[View $spacekey:$page|$wikibaseurl/pages/viewpage.action?pageId=$pageid] [Edit $spacekey:$page|$wikibaseurl/pages/editpage.action?pageId=$pageid]
Do you know what Space the page is in?
You can get the Page object via the pageManager with
getPage(String spaceKey, String pageTitle);
Then you can get the Id from the Page object
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.