List all unchecked tasks in a space
Asked by Robin Gau?:

Hello,  
we are using confluence 5.1.2 to manage our meeting notes. We also use the inline task list feature to create and assign tasks.   
Im trying to get a list of all the unfished / unchecked tasks in a certain space.

The Usermacro i did so far:  

```
## Macroname: ShowTaskList## Body Processing: Escapes## @noparams&lt;table border = "1"&gt;&lt;tr&gt;&lt;td&gt;Pagelink&lt;/td&gt;&lt;/tr&gt;#foreach($page in $space.getHomePage().getDescendents())	#foreach($label in $page.getLabels() )		#if($label.getName() == 'protokoll')			&lt;tr&gt;			&lt;td&gt;			&lt;a href="$page.getUrlPath()"&gt;$page.getTitle()&lt;/a&gt;			$page.getBodyAsString()			&lt;/td&gt;			&lt;/tr&gt;		#end	#end#end&lt;/table&gt;
```

I can get the body of all meeting notes in a certain space with this macro but i was unable to filter the output for the unsfinished tasks.

The output i like to generate is the unfinished task with the assgined person and the row of the table containing that task.

Regards,  
Robin


Answers:
author: Robin Gau?
body: I finally finished my plugin. You can find the code here:  

<https://bitbucket.org/robingauss/confluence-inline-tasklist-overview>   

You will need to modify the code to search for the right protocoll structure.  

Regards,  
Robin

comments: author: David Kraljic
body: Robin, very excited to have found your plugin. But I must admit I do not understand how to install it. Any advice would be greatly appreciatted. Also, if your comoftable releaseing it I bet there a ton of people willing to pay for this. You might have a small window as I bet atlassian will bake this into confluence directly at some point.


author: Robin Gau?
body: Hello David,  
it's quite difficult to install this plugin if you're not familiar with the atlassian sdk. I released the source code only because the code needs some modifications in order to work with a specific protocol layout.   
In the current form the tasks have to be in a table with a 2 column layout, where the 2nd column holds the tasks.

I added a compiled plugin to my bitbucket repo for people using this layout:

<https://bitbucket.org/robingauss/confluence-inline-tasklist-overview/downloads/Inline-Task-Overview-1.5.jar>

I will also add some more informations there.  

I'm not willing to release this as a commerical plugin because i don't have the time to maintain this project.  

Regards,  
Robin


author: David Kraljic
body: Thanks for posting the jar. I'll give it a shot. I'm assuming that by two column layout you mean page layout, not a 2 column table on a single page.


author: Robin Gau?
body: No i mean an usual table.


author: David Turvey
body: Hi Robin,

I couldn't get this to work for my tasks. I guess it has something to do with your expected 2 column table layout.

I forked your project at <https://bitbucket.org/davidturvey/confluence-inline-tasklist-overview> . This version just dumps contents of each task onto a one column table. It doesn't use any special layout.

Thanks for writing your project. I don't think i would have figured any of this out without your code as a starting point.

David


author: David Kraljic
body: @David Turvey I don't suppose you could create a jar that I could upload or otherwise provide instructions on how to install your forked version? BTW - I had the same problem with Robin's version. It did report on tasks but only from one page, seemingly random - even though many pages had the tasks in a similar 2 column format.

Edit - nevermind. Found your download David. Although it is reporting the same way Robin's did only in one column. THat is that it only reports tasks from one page. The same one Robin's reported from


author: David Turvey
body: ### @David Kraljic , which version of confluence are you using? I have only tested with 5.1. The plugin relies on the task list format posted in Ryan Goodwins comment. I look for \<ac:task-list elements\> and extract the contents of the \<ac:task-body\> elements found within. Use "Tools \> View storage format" on the pages that don't work to check they match this format. If you are still having problems send me a copy of your storage format output and i'll have a look. We can discuss this further via the issue tracker on my bitbucket repository rather than clog up the comment sectionhere. {#toc-hId-1484122607}


author: Ryan Goodwin
body: Hi Robin,

I set up a test page with 3 tasks assigned to various users and saved the page. I then checked off one of the tasks and selected Tools \> View Storage Format. This is the resulting data:

```
&lt;p&gt;macro task list unchecked test&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ac:task-list&gt;&lt;ac:task&gt;&lt;ac:task-id&gt;7&lt;/ac:task-id&gt;&lt;ac:task-status&gt;incomplete&lt;/ac:task-status&gt;&lt;ac:task-body&gt;&lt;span&gt;&lt;ac:link&gt;&lt;ri:user ri:username="ryan@localhost.com" /&gt;&lt;/ac:link&gt; some task&lt;/span&gt;&lt;/ac:task-body&gt;&lt;/ac:task&gt;&lt;ac:task&gt;&lt;ac:task-id&gt;8&lt;/ac:task-id&gt;&lt;ac:task-status&gt;incomplete&lt;/ac:task-status&gt;&lt;ac:task-body&gt;&lt;span&gt;&lt;ac:link&gt;&lt;ri:user ri:username="porter123" /&gt;&lt;/ac:link&gt; some task&lt;br /&gt;&lt;/span&gt;&lt;/ac:task-body&gt;&lt;/ac:task&gt;&lt;ac:task&gt;&lt;ac:task-id&gt;9&lt;/ac:task-id&gt;&lt;ac:task-status&gt;complete&lt;/ac:task-status&gt;&lt;ac:task-body&gt;&lt;ac:link&gt;&lt;ri:user ri:username="admin" /&gt;&lt;/ac:link&gt; some task&lt;/ac:task-body&gt;&lt;/ac:task&gt;&lt;/ac:task-list&gt;
```

I'm not familiar with writing user macros, but I am assuming you should be able to reference or grep out the \<ac:task-status\>incomplete references and associate them with task-body username information to compile a list.

Maybe someone else can elaborate on how you can utilize this storage format data.

Hope this helps!

comments: author: Robin Gau?
body: Hello Ryan,  
thanks for your respond.  
Your suggestion is exactly what i want to achieve with my macro. But i'm really struggling with the [Confluence API](http://docs.atlassian.com/atlassian-confluence/latest/ "Confluence API"). I can't find the propper methods to access / filter the storage format with a user macro.   
Maybe someone else has done something similar with a macro and can give me some advice.  

Regards,  
Robin


author: Robin Gau?
body: Hello,  
i want to give a short heads up for all the followers to this question.   
I tried to generate the inline tasklist overview for one space via the user macros with no success.   
The problem is that i can't reach the XHTML markup with those methods.   
Thats why i started to develop a plugin with the sdk. I will post an update here as soon as i finish this plugin.

We need this feature to work propperly with the tasks in confluence. I still can't understand why this function wasn't implemented by atlassian in the first place.

Regards,  
Robin


Tags: task

tasklist

user-macro