Macro space key look to currrent space

When copying a page across a space, or copying spaces. Many of the Confluence Macros have a field in them called 'Space Key' that will always reference it's originating space. It would be nice if this key could have a field option of 'Use Current Space' or something like that.

Example Macro where this becomes an issue - Create from Template

Every time a page is copied that has this macro, it must be updated to include the new space to ensure new pages are placed under the correct space

Is there anyway to make this happen?

2 answers

Another approach would be to wrap this with a user macro that gets the current space key and writes and executes the macro.

Davin Studer Community Champion Nov 05, 2014

That is what I was going to say. :)

I'll have to see if I can't get someone to help me make that happen

Davin Studer Community Champion Nov 05, 2014

Which macro is it?

I needed to find the Space Key for my personal page. I looked at the source code for my page and saw that it was ~[myname].

When I put that in the space key for the macro it worked!! :-)

With some macros, you can use @self.  With others, if you leave the key field blank it defaults to the current space.

The field is required, and @self creates: Error rendering macro 'create-from-template' : No space found with space key: @self

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,775 views 26 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you