Please consider implementing the use case you are looking for using a LivePage.
Purpose:
You want to draw a table of Work Items with some custom fields and be able to update attributes of Work Items on mouse click.
Here is an example how to combine JavaScript and Velocity code to update boolean field of several Work Items at once.
Installation:
- Copy text to a wiki page.
- Update correspondingly (as you wish) table to be shown and fields mapped
#set($items = $trackerService.queryWorkItems("project.id:$page.space.projectId AND type:requirement","~id"))
<table border="1">
#foreach($item in $items)
<tr>
<td>$item.getId()</td>
<td>$item.getTitle()</td>
#registerSwitch($item.getId() "test")
</tr>
#end
</table>
<button type="button" onclick=save()>Save</button>
- Enjoy :-)
How to test:
- Open E-Library on your test installation (E-Library project is read-only on the Demo Servers)
- Add "test" as boolean field to custom fields of Requirement Work Item type
- Open the page
- See list of the requirements shown with "true" or "false" displayed on the right side
- Clicking on the value will change them to the opposite
- Clicking "Save" button will pass all the changed objects as URL parameters to the same page for Velocity processing of the Work Items