How can I use a task-list in a user defined confluence macro?

Hello,

I wrote a little macro displaying a task list and a hyperlink (see code below)

But when I insert this macro with {translationstate} in my article, I can not stored the user selection when changing the checkboxes.

Error message is:"Your task could not be saved. This might have several reasons."

 

Does anyone know how I can use task lists within my template so that the confluence users can stored their changes for the checkboxes?

Thank you,

 

 

As option for macro body processing I selected "Rendered".

Here is the template code:

## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name
## @noparams
<ac:structured-macro ac:name="panel"><ac:parameter ac:name="borderColor">#2189C7</ac:parameter><ac:parameter ac:name="titleColor">#FFFFFF</ac:parameter><ac:parameter ac:name="borderWidth">2</ac:parameter><ac:parameter ac:name="titleBGColor">#41A9E7</ac:parameter><ac:parameter ac:name="title">State of translation</ac:parameter><ac:rich-text-body><ac:task-list>
<ac:task>
<ac:task-id>9</ac:task-id>
<ac:task-status>incomplete</ac:task-status>
<ac:task-body><span>English translation</span></ac:task-body>
</ac:task>
<ac:task>
<ac:task-id>6</ac:task-id>
<ac:task-status>incomplete</ac:task-status>
<ac:task-body><span>Spanish translation</span></ac:task-body>
</ac:task>
</ac:task-list>

<p><span><ac:link><ri:page ri:content-title="Pflege der Artikel-&Uuml;bersetzungen" ri:space-key="WERK" /><ac:plain-text-link-body><![CDATA[How to maintain translations]]></ac:plain-text-link-body></ac:link><br /></span></p></ac:rich-text-body></ac:structured-macro>

 

Created output in the confluence article when using the macro:

StateOfTranslation.PNG

1 answer

Hello Thomas,

I never tried this, but I'd think that this won't work. Task lists try to save their status to the confluence page, means checking a task results in a page change.
If the task list is part of a user macro, the task list source code is not part of the page. Each time you open the page, the task list will be rendered anew (from the macro code). There's no "place" to store changes of tasks.

Regards,
Kirstin

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

867 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you