Polarion – Update Work Item with Wiki page

Problem

  • You want to update a polarion work item with a wiki page
  • (You want to update several work items)

Solution

First, if you have no wiki page, create one.

The following code i use regularly to update a bunch of work items. In this example i update a custom field “test” (type String).

## Get project id
#set($projectId = $doc.getProject($doc.getSpace()))
## Get project object
#set($pro = $projectService.getProject($projectId))
## Get the objects
#set($objects = $trackerService.queryWorkItems($pro, “type:requirement”, “id”)
## Iteration
#foreach($entry in $objects)
## Open Transaction
$transactionService.beginTx()
## Set field
$entry.setCustomField(“test”, $texta)
## Don’t forget to save
$entry.save()
## Transaction commit
$transactionService.commitTx()
#end

Fin