I can insert the Task Report macro, and what I'm hoping to do is include a filter for the page being created by the template.
Here you are:
## Macro title: Task Report for Templates ## Macro has a body: N ## ## Desc: ## Contains the @self variable for pagename. ## I am too lazy to edit pages after creating, just for this one macro edit. ## ## Developed by: aho ## Date created: 2015-04-29 ## Installed by: aho, 2015-04-29 ## @noparams <ac:structured-macro ac:name="tasks-report-macro"> <ac:parameter ac:name="pages">$content.id</ac:parameter> </ac:structured-macro>
We are useing this macro for creating, migrating and editing documents and policies in confluence together with the following macro for creating documents from templates. Feel free to use both of them.
See here
For the macro below:
I dont know how to parse the $baseURL correctly, so you got to enter the URL manually, sorry for this. ($paramBaseURL = 'FQDN' <- fill out the variable in the code before useing)
## Macro title # create-site_v4 ## Macro has a body # N ## Body processing # Selected body processing option ## ## Developed by # Alexander Horn ## Initial idea from # Seibert Media GmbH (get simple code there) ## Date created # 2014-11-19 ## Version of the macro # v4 ## Installed by # <whoever> ## Description # Macro to create a page by clicking a button. Configute pre- and suffixes for sitenames, choose templates and spaces and the parent pages for the new site. ## Project context # Change Management with Confluence as CMDB ## Macro ## @param Button:title=Button name|type=string|default=Create Page|desc=Name of the button for page creation ## @param Size:title=Button Size|type=enum|enumValues=inline-block,block|default=inline-block|desc=Choose displayed button size ## Page ## @param PageTitle:title=Pagename dummy|type=string|desc=Dummy name for pages created by this macro. A whitespace will be used, if empty. Plz use prefixes or suffixes in this case. ## @param Prefix:title=Prefix for pagename|type=string|required=false|desc=Prefix to use for pagenames. ## @param PostfixDate:title=Use date as sufffix for pagename|type=boolean|required=false|desc=Date will be set as a sufffix for pagenames. You should choose a date format. ## @param DateFormat:title=Choose date format|type=enum|enumValues=yyyy-MM-dd,yyyy-MM-dd hh:mm,dd. MMM yyyy,dd. MMM yyyy hh:mm|required=false|desc=Date format will be used for suffixes ## @param PostfixParent:title=Use parent site as suffix for pagename|type=boolean|required=false|desc=Parent site will be set as a sufffix for pagename. If used with date, parent page title will be set before date suffix. ## @param PageID:title=Target parent page|type=int|required=false|desc=Select a parent page ID where created pages will be stored as childs. If empty, current page will be assumed. ## @param Template:title=Template|type=int|required=true|desc=Template ID which should be used as framework for created pages. ## @param Key:title=Space-Key|type=spacekey|desc=Choose the space which will be storing the created pages. ## Server ## @param Protocol:title=Protocol type|type=enum|enumValues=http,https|default=https|desc=If SSL used select the "https" value ## @param BaseURL:title=Confluence-URL|type=string|desc=URL of Confluence (should be FQDN?). <style type="text/css"> .macrocontent, .macrocontent a:focus, .macrocontent a:hover, .macrocontent a:active { background: linear-gradient(to bottom, #FFF 0px, #F2F2F2 100%) repeat scroll 0% 0% transparent; border: 1px solid #CCC; border-radius: 3.01px; box-sizing: border-box; cursor: pointer; display: $paramSize !important; font-family: inherit; font-size: 14px; font-weight: normal; height: 2.14286em; line-height: 1.42857; margin: 0px; padding: 4px 10px; text-shadow: 0px 1px 0px #FFF; vertical-align: baseline; white-space: nowrap; text-decoration: none !important; color: #333 !important; font-variant: small-caps; } </style> ## ## The default values for your server configuration to speed up the useing of the macro ## Delete this block for first use ## Delete this block if you share this macro. #if ( !$paramProtocol) #set ( $paramProtocol = 'https' ) #end #if ( !$paramBaseURL) #set ( $paramBaseURL = 'FIXME FQDN HERE' ) #end #if ( !$paramKey) #set ( $paramKey = $space.key ) #end ## End of block for serverconfig ## ## Set current page as parent, if not set by user #if ( !$paramPageID) #set ( $paramPageID = $content.id ) #end ## Set prefix, if parameter Prefix is set by user #if ( $paramPrefix ) #set ( $paramPageTitle = $paramPrefix + $paramPageTitle ) #end ## Set default date format, if not set, but postfix option is used #if ( !$paramDateFormat ) #set ( $paramDateFormat = 'yyyy-MM-dd' ) #end ## Set postfix set by user #if ( $paramPostfixParent == true) #set ( $paramPageTitle = $paramPageTitle + ' - ' + $content.getTitle() ) #end #if ( $paramPostfixDate == true) #set ( $paramPageTitle = $paramPageTitle + ' - ' + $action.dateFormatter.formatGivenString($paramDateFormat, $content.currentDate) ) #end ## Create the site <a class="macrocontent" href="$paramProtocol://$paramBaseURL/pages/createpage-entervariables.action?templateId=$paramTemplate&spaceKey=$paramKey&title=$paramPageTitle&newSpaceKey=$paramKey&fromPageId=$paramPageID">$paramButton</a>
You can create a user macro as a wrapper to the task report macro that will pass the current page to the task report. See the below link for an example of wrapping a task report macro with a user macro. Instead of swapping out the user parameter though you would be swapping out the page parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dang! I got super excited until I discovered that I don't have the ability to create a User Macro in the On Demand version of Confluence! :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, shoot. I don't know another way other than that. That is once of the main reasons I don't like the OnDemand version ... too limited.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Davin,
Thanks for that suggestion. Unfortunately, it doesn't solve my problem as each new page I create from that template would show the Task Report for all other pages created from that template.
The ideal solution would be to have a token that I could add to the Task Report macro so that the first filter text box could support something like "@currentPage".
The newly created page would include a Task Report that lists all Incomplete Tasks from that page (would be blank with initial save).
By using a Label, that new page would list Tasks from all other pages with the same Label. So that would be a fail.
Does that make sense?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry. I misunderstood the question. See my new answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add a label to your template that is specific to that template. Every page created from the template will also get the label. Then restrict your task report macro to that label.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am looking for the exact same thing, did you find a solution? (I am also not allowed to create my own macros)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What you would do is give your template a label and then in the task report macro filter to pages with that label. That should make sure that you only see tasks for pages created with the template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.