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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s