Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Macro/Plugin to assign new documents with a unique reference number

Serdar Mustafa January 13, 2019

General overview:
The plugin creates a Macro, that can be used to assign new documents in Confluence with a unique document number.

Macro would do something like this:

IR – Incident Report:
The structure of the document number is:
XX-YYYY-dtDDHHMM where dt = Document Type

Functional limitations:
The document number is to be generated on initial save of the document and should not update if changes are made at a later time.

Any ideas how I can achieve this?

2 answers

0 votes
James Dellow
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2019

The Create from Template macro does allow you to insert the date into the title, although this is limited to YYYY-MM-DD. However, users can easily overwrite this.

But what's your use case here?

Out of the box, Confluence knows what a document is first created - the only thing that isn't part of the standard meta-data would be what you call the document type, since everything is a page (or a blogpost).

You may be able to develop something to do this, using development features such as Webhooks, Custom Content types, and custom Content Properties.

But equally you might achieve the same using default macros, like the Page Properties and Page Properties Report macros to track document type.

Serdar Mustafa January 15, 2019

Use case - It would be used to assign a unique reference number to a document in the existing company format. Think along the lines of a case or doc reference number you might see on a headed letter (see example below).

 

angl-9oktyabrya_business_letters_3.jpg

James Dellow
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2019

If you are tied to the existing format, then the only way I can think of achieving this is as I outlined above.

An easier option for a unique reference number would be to use the Page ID.

Serdar Mustafa January 15, 2019

Thanks for the guidance James. I will look into the template option you mentioned. 

0 votes
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.
January 13, 2019

Not on Cloud, there's no way to add the sort of macro you would need.

Serdar Mustafa January 13, 2019

Thanks for your insight - I am exploring the possibility of writing a plugin; should I progress with it, I will post the solution here. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events