Solution
Use the Default Placeholders:
__target_space_key__
__source_space_key__
Workaround Example
If invalid input is allowed:
You can combine the Default Placeholder with your page title as following:
If invalid input is not allowed:
You must first install a Storage Format editor (e.g. this one from Atlassian Confluence Source Editor). After installing this plugin, you can easily edit the storage format:
Find the <ri:page … />
or <ri:space … />
element for the macro where you have the problem and edit it as follows:
<ri:page ri:content-title="Your Page Title"/>
results in:
<ri:page ri:content-title="Your Page Title" ri:space-key="__target_space_key__"/>
CODE
<ri:space ri:space-key="SPACEKEY"/>
result in:
<ri:space ri:space-key="__target_space_key__"/>
CODE
Note:
If you want a reference to the source space, use __source_space_key__
instead of __target_space_key__