Task List Macro

This is the first example library, that comes with Confluence itself!

It creates a simple task list (one task per line) that can be checked off by users as they complete the tasks. The task 'checking' is persisted in the page meta data.

It also persists and displays the specific user who completed a given task, as well as an overall progress meter for the list of tasks.

Usage

It's a very simple macro, the syntax looks like this:

{tasklist:My Shopping List}
Buy apples
Purchase new table
Collect laundry
{tasklist}

Screenshot

Here's what the macro looks like when operating:

Download & Installation

  1. Download
  2. Drop it into WEB-INF/lib inside the Confluence web application
  3. Restart Confluence!

Any feedback or queries, contact me.

Online Test

[TEST:test tasklist macro]

Labels

plugin plugin Delete
repository_testing repository_testing Delete
non-repository non-repository Delete
tasklist tasklist Delete
macro macro Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 15, 2004

    Jonas Björnerstedt says:

    I like the idea of this macro. It would be really interesting if it was combined...

    I like the idea of this macro. It would be really interesting if it was combined with the Children display macro. Each task typically has subtasks. A new release for example requires a number of features to be implemented, each consisting of a number of issues. To see what the status of a project is, one wants to see a summary of how much progress has been made on each subtask.

    The simplest setup would be a "Task Children Display", with a taskbar for each child that has a tasklist (or a Task children display) macro.

    If subtasks could be Jira issues, even better!

  2. Oct 11, 2004

    Andrew Reid says:

    Very useful macro, Mike. However normal confluence markup doesn't seem to work f...

    Very useful macro, Mike. However normal confluence markup doesn't seem to work for the entry text (eg *Bold*)

    1. Oct 06, 2005

      Mingyi Liu says:

      Seems the markup works now.

      Seems the markup works now.

  3. Dec 14, 2004

    Amos Gouaux says:

    Two comments about this nifty feature: # It appears that the Anonymous user can...

    Two comments about this nifty feature:

    1. It appears that the Anonymous user can check-off an item on the tasklist, even if Anonymous doesn't have edit privs on the page.
    2. It would be nice if the date were (optionally?) displayed by the name of the individual that checked-off the item. (No, haven't had a chance to look at the source yet.)
  4. Jun 02, 2005

    ybchen says:

    I found that this marco can't work with Chinese character. Only work in English.

    I found that this marco can't work with Chinese character.
    Only work in English.

    1. Aug 17, 2005

      qxo says:

      I fixed the encoding problem. There is the TaskListMacro.vm <table class="gri...

      I fixed the encoding problem.
      There is the TaskListMacro.vm

      <table class="grid">
          <tr>
              <th>Tasks: $!tasklist.name</th>
              #set ($percentIncomplete = 100 - $tasklist.percentComplete)
              <th><table width="120" height="8" cellpadding="0" cellspacing="0" border="0"><tr>
                      #if ($tasklist.percentComplete > 0)<td width="$tasklist.percentComplete%" class="greenbar"></td>#end
                      #if ($percentIncomplete > 0)<td width="$percentIncomplete%" class="redbar"></td>#end
              </tr></table></th>
          </tr>
          
          #foreach ($task in $tasklist.tasks)
              <tr>
                  <td>$task.renderedName</td>
                  <td>
            
                  
                      #if ($task.completed == true)
                          <a href="${req.contextPath}$generalUtil.appendAmpsandOrQuestionMark($content.urlPath)" onclick="return doSubmit(this,'$task.name','tasklist.uncomplete')"><img src="$req.contextPath/images/icons/emoticons/check.gif" border=0 align=absmiddle height=16 width=16></a>
                          <span class="smalltext">(<a href="$req.contextPath/display/~$generalUtil.urlEncode($task.completer)">$task.completer</a>)</span>
                      #else
                          <a href="${req.contextPath}$generalUtil.appendAmpsandOrQuestionMark($content.urlPath)" onclick="return doSubmit(this,'$task.name','tasklist.complete')"><img src="$req.contextPath/images/icons/emoticons/error.gif" border=0  align=absmiddle height=16 width=16></a>
                      #end
                 
      
                  </td>
              </tr>
          #end
          <tr style="display:none" ><td>
          <form id="taskForm" method="post">
      				<input type="hidden" id="op" name="tasklist.complete" value="-" >    
          </form>
      <script language="javascript">
      	function doSubmit(obj,taskName,actionName){
      	    var form = document.getElementById("taskForm"); 
      	    form.action = obj.href;
      	    	    
      	    var input = document.getElementById("op");    
      	   
      	   input.name = actionName;
      	    // this.parentNode.parentNode.firstChild.innerHTML;
      	   input.value = taskName;
      	   
      	   //alert(form.action +taskName+input.name);
      	   	   
      	    form.submit();    
      			return false;	    
      		}
      </script>
      
          </td>
          </tr>
      </table>
  5. Jun 09, 2005

    Horst Tappert says:

    There have been deserialization problems after upgrading jvm from 1.4 to 1.5. Th...

    There have been deserialization problems after upgrading jvm from 1.4 to 1.5. This could be a problem.

  6. Oct 06, 2005

    Mingyi Liu says:

    Great macro\! Would be nicer if \ gives headerless list, while \ still simulates...

    Great macro! Would be nicer if {tasklist} gives header-less list, while {tasklist: } still simulates title-less list. Just adding two lines would do (the first and last lines below):

    #if ($tasklist.name)
    <tr>
    <th>Tasks: $\!tasklist.name</th>
    #set ($percentIncomplete = 100 - $tasklist.percentComplete)
    <th><table width="120" height="8" cellpadding="0" cellspacing="0" border="0"><tr>
    #if ($tasklist.percentComplete > 0)<td width="$tasklist.percentComplete%" class="greenbar"></td>#end
    #if ($percentIncomplete > 0)<td width="$percentIncomplete%" class="redbar"></td>#end
    </tr></table></th>
    </tr>
    #end
  7. Oct 12, 2005

    deezer says:

    Is there any way to create a task that contains a table or other block of conten...

    Is there any way to create a task that contains a table or other block of content, or must it be one single line?

    1. Oct 12, 2005

      David Loeng says:

      Given the way the macro was implemented, it must be on a single line.

      Given the way the macro was implemented, it must be on a single line.

    2. Jan 23, 2006

      Andy Armstrong says:

      I really like the task list macro, but it would be so much more useful with supp...

      I really like the task list macro, but it would be so much more useful with support for additional columns. Here's a typical task list that we use all the time:

      Task Owner Due Date Status
      Complete the user documentation Andy 01/20/2006
      Add forums to the website Andy 01/31/2006
      Fix the build process David 01/26/2006

      Because it has multiple columns we can't use the task list macro, so we have to switch into edit mode to mark something as done.

      I'd love to see this macro extended to support columns. It would need some way to specify the columns titles, and then a way to separate each column within a task. Something like this might work:

      {tasklist:My Tasks}
      ||Task||Owner||Due Date||
      | Complete the user documentation | Andy | 01/20/2006 |
      | Add forums to the website | Andy | 01/31/2006 | 
      | Fix the build process | David | 01/26/2006 |
      {tasklist}
      

      Note that the status column would then be 'magically' added as the last column.

      I realize that there is overlap here between Confluence and JIRA. We use both and I definitely wouldn't see this as a replacement for JIRA. It is very useful for simple lists of tasks, e.g. the actions from a meeting. It wouldn't make sense to track those in JIRA, but it is really useful to go back to last weeks meeting notes and make sure that all the actions are completed.

      1. Jan 23, 2006

        Guy Fraser says:

        You might be able to achieve something similar with Scaffold templates see Tabul...

        You might be able to achieve something similar with Scaffold templates - see Tabular Notes Scaffold for an example.

        1. Jan 23, 2006

          David Peterson says:

          Yeah, you could fudge something in there, but it's still not ideal I've wished t...

          Yeah, you could fudge something in there, but it's still not ideal - I've wished there was a scaffold-friendly task list on a couple of occasions myself, but it hasn't happened yet...

  8. Mar 03, 2006

    Keith R. Bennett says:

    Unfortunately, there is a problem with multiple tasklists on a page. I haven't l...

    Unfortunately, there is a problem with multiple tasklists on a page. I haven't looked at the source code, but it looks like the text strings for the checkboxes are not local to the instance of the tasklist, but global to the page. That is, if there are multiple tasklists with identical strings (see wiki example below), checking one will result in all others with that string displayed as checked.

    tasklist: Task lists can not be used in comments.

    Jan
    Feb
    Mar

    tasklist: Task lists can not be used in comments.

    Jan
    Feb
    Mar


    Keith R. Bennett

    1. Mar 03, 2006

      Keith R. Bennett says:

      I just found out that clicking on the tasklist above will not have any effect. I...

      I just found out that clicking on the tasklist above will not have any effect. I'll put that wiki code here, unformatted, so you can copy and paste it to your own wiki to test if you like:

      {tasklist:1}
      Jan
      Feb
      Mar
      {tasklist}
      
      {tasklist:2}
      Jan
      Feb
      Mar
      {tasklist}
      
      


      Keith R. Bennett

  9. Apr 18, 2007

    Yao Ge says:

    It seems that embeding links in the task list item does not work with Rich Text ...

    It seems that embeding links in the task list item does not work with Rich Text Editor. You can do it in the WikiMark editor though:

    {tasklist:TODO}
    [item 1|First thing]
    {tasklist}