How to use the advanced format to pre select a page

Since version 7.0.6.1 of the Issue Publisher you can define an advanced format to pre select the page in an operation.

Constant page

To reference a constant page simply enter the page ID.

123456

Custom field

If a custom field contains the page ID use the $fieldHelper.

$!fieldHelper.getValueAsString("My field with the page ID")

Custom field on different issue

A custom field on another issue contains the page ID. That issue can be found via a JQL search. Note: The JQL string can contain variables as well.

#set($otherIssue = $!issueHelper.findIssue("key = TEST-123"))
$!fieldHelper.getValueAsString($otherIssue, "My field with the page ID")

The other issue is selected in an Issue Picker custom field.

#set($otherIssue = $!issueHelper.getIssue($!fieldHelper.getValueAsString("My Issue Picker field")))
$!fieldHelper.getValueAsString($otherIssue, "My field with the page ID")

With the space key and page title

Since version 8.1.0 you can also pre select a page if you only know the space key and page title.

$confluenceHelper.findPage("SpaceKey", "A Page Title").getId()

Of course the space key and page title can be variable and come from other custom fields or anything else.

#set($issueWithSpaceKey = $!issueHelper.findIssue("key = TEST-123"))
#set($spaceKey = $!fieldHelper.getValueAsString($issueWithSpaceKey, "Field with space key"))
$confluenceHelper.findPage($!spaceKey, $!fieldHelper.getValueAsString("Field with page title")).getId()