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

How can I automatically create numbered pages with confluence, e.g. FAQ001, FAQ002?

Cedric Weber May 31, 2011

I want to spare my users from thinking about a pagetitle and rather not publishing a topic. Pages should be created with a defined prefix (e.g. FAQ) followed by defined numbering (e.g. 3 digits FAQ001, FAQ002, ..., FAQnnn).

Users can focus on content an do not need to bother on (conflicting or dumb) pagetitles. Is there a way (extension etc.) to realize this within confluence?

5 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
David Peterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2011

You can use the {add-page} macro from the Linking Plugin in conjunction with the 'Child Counter Supplier' to provide a link that, when clicked, will create a new page with an automatic number. See here for details:

http://www.customware.net/repository/display/AtlassianPlugins/Child+Counter+Supplier

Specifically, however, it would be something like this:

{add-page:name=Child Page %child-counter:next > number:000%}Add 'Child Page {report-info:child-counter:next}'{add-page}
 
Hope that helps!

Cedric Weber June 5, 2011
Thank you, this might help. The Problem with this solution seems to be if pages are deleted. E.g. create "Child Page 001" - "Child Page 004" and delete "Child Page 003". Since only the number of child-pages are counted, the macro will try create "Child Page 004" which already exists.
David Peterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2011
Child Counter is specifically designed to address that issue and doesn't depend on the current number of children. Rather, it keeps track of the total number of pages that have been created with it.
Cedric Weber June 5, 2011
Right, I had some other problems with the setup. As far as I see this will do the job!
Cedric Weber June 5, 2011
Btw, the Plugins required are: Linking Plugin, https://plugins.atlassian.com/plugin/details/166 and Reporting Plugin: https://plugins.atlassian.com/plugin/details/186
Tim
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2012

Since Confluence 4 and the removal of wikimarkup, it is no longer possible to set the "name" parameter for the "add-page"-macro, since it is missing in the macro-browser. Therefore I can't generate a new page without this intermediate page asking me to input a page name.

Cedric Weber April 25, 2012

@David: is there a way to reset the counter after lots of useless testing that I've done? Somewhere in the database?

2 votes
Patrik Thürlemann February 9, 2015

This thread is already a bit older.
But I have the same problem at the moment.

I'm creating new pages with a "space template"  . I would like to have the name of the ne page created automaticli with a increment     .     The page name should consist of a prefix and a increment. (As Cedric Weber mentioned)

We are currently using Confluence 5.3.1, are there allready  implemted  solutions to do so?

Thanks for any advice
Patrik

 

Richard Shandelman November 2, 2015

I would be interested with that type of solution for confluence versions 5.x as well

James Leighs May 21, 2019

Have there been any updates in terms of pages having a unique number according to some pre-defined rules, which is auto-generated when you create the page?

1 vote
Andrei [errno]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 1, 2011

i use confluence-cli plugin (tool): https://studio.plugins.atlassian.com/wiki/display/CSOAP/Confluence+Command+Line+Interface

a simple driver script that would loop from FAQ001 through FAQ999 and call cli's addPage would do a trick for you

EDIT:

here is a Ruby snippet i use to batch-create multiple pages (could be used to remove pages as well)

# ==========
def run_confluence_sh(log,to_run)
to_run = "/home/atlassian/atlassian/_CODE/atlassian-cli/confluence.sh " + to_run
log.debug to_run
out = `#{to_run} 2>&1`

if $?.exitstatus > 0 then
log.debug "===> FAIL"
log.debug $?.exitstatus
log.debug out
send_email Send_email_to, :body => "FAILED #{out}"
exit
end
end

# ==========

my_action = "addPage"
pageNames = ["1","34","4534","214"]

pageNames.each do |pageName|
run_confluence_sh(log, "--action #{my_action} --space 'ABC' --parent 'ParentPage' --title '#{pageName}' --file '#{my_home}/template-0.txt'")
end # block

template-0.txt would contain wiki markup

1 vote
Leandro Nunes May 31, 2011

I believe you won't be able to it natively on Confluence. However, there's a plugin which can helps with:

https://studio.plugins.atlassian.com/wiki/display/CREATE/Create+Page+Plugin

As the description says:

"The {create-page} macro asks the user for the name of the page and then creates it based on a template.
More information can be found in our userguide"

Maybe it isn't what you're exactly looking for, but should help though.

Cheers!

Cedric Weber May 31, 2011

That's what I've found as well, but that's not enough. AFAIK the user still has to think about a pagename instead of just creating a page based on a simple form.

0 votes
Ruchi Tandon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 31, 2011

Hi

You could use Office Connector's import page functionality and select the option for "Rename imported pages if page name already exists". This would automatically append a number 0...9 against the page name if the page names conflict.

Not sure if there is a similar functionality available while creating pages.

Ruchi

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events