Polarion – Create Work Item with Wiki page

Problem

  • You want to create a polarion work item with a wiki page

Solution

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

In Polarion you have to create a work item stub in the first step. Subsequent, fill the needed fields and finally save the object.

## Get project id
#set($projectId = $doc.getProject($doc.getSpace()))
## Get project object
#set(pro = $projectService.getProject($tprojectId))
## get trackerproject to create stub
#set($tpro = $trackerService.getTrackerProject($pro))

## Open transaction
$transactionService.beginTx()
## Create stub
#set($newWI = $tpro.createWorkItem(“requirement”))
## Set whatever you want
$newWI.set…
$newWI.set…
$newWI.set…
$newWI.set…
$newWI.setCustomField(…
$newWI.setCustomField(…
$newWI.setCustomField(…
$newWI.setCustomField(…

## Dont forget to save
$newI.save()
## Close transaction
$transactionService.commitTx()

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