Create page with an increasing UID and set prefix.

Dr Yann Golanski June 20, 2019

I would like to write a template, usable in any spaces, that creates a page with a unique incremental ID and one of a set of allowed prefixes. This UID/prefix would be used as part of the page title and in a page property table.

We have some historical data that needs to be imported in that format as well, therefore we cannot use the Confluence UID and would need something that has a REST API as manually uploading hundreds of documents is not feasible.

 

The page title format would be something akin to

 ${PREFIX}${UID} - ${TITLE}

Is that possible?

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 20, 2019

You will need to write code to replace the template functionality that leaves the page title open for the user, and replace the code that allows users to edit the title too.

Dr Yann Golanski June 20, 2019

I was thinking the title would become a macro with an editable field called "description" that would be appended to the prefix/UID. After all, what it is called could feasibly change but must retain the same prefix/UID.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 20, 2019

You could do something with a macro, but you would then

  • be relying on the user to put the macro on the page (or not remove it from the templated text)
  • still have the users free to rename the page
  • I'm not sure a macro can edit the page name just by being added to a page, I suspect you'll need to write an app to provide the macro and code to update the name

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events