List all unchecked tasks in a space

Robin Gauß April 25, 2013

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

<table border = "1">
<tr>
<td>Pagelink</td>
</tr>


#foreach($page in $space.getHomePage().getDescendents())

	#foreach($label in $page.getLabels() )
		#if($label.getName() == 'protokoll')
			<tr>
			<td>
			<a href="$page.getUrlPath()">$page.getTitle()</a>

			$page.getBodyAsString()
			</td>
			</tr>
		#end
	#end
#end

</table>

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

2 answers

1 accepted

0 votes
Answer accepted
Robin Gauß July 18, 2013

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

David Kraljic August 8, 2013

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.

Robin Gauß August 8, 2013

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

David Kraljic August 8, 2013

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.

Robin Gauß August 8, 2013

No i mean an usual table.

David Turvey August 8, 2013

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

David Kraljic August 8, 2013

@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

David Turvey August 12, 2013

@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.

3 votes
Ryan Goodwin
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 26, 2013

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!

Robin Gauß April 29, 2013

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. 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

Robin Gauß June 3, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events