Update workitem from velocity script

Description
Raj
Posts: 2
Joined: Fri Aug 19, 2016 11:34 am

Update workitem from velocity script

Postby Raj » Mon Jul 09, 2018 11:36 am

Hello

How to update description and contents of a workitem from velocity script?

scharph
Posts: 3
Joined: Wed Jul 04, 2018 9:19 am

Re: Update workitem from velocity script

Postby scharph » Mon Aug 20, 2018 7:56 am

https://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/ws/client/types/tracker/WorkItem.html

Code: Select all

$transactionService.beginTx()

#set($newDate = "2018-08-20")
#set( $wis= $trackerProject.queryWorkItems("dueDate:$newDate", "id") )
#foreach ($wi in $wis)

   #Get the old title
   $wi.getTitle()
   $wi.setTitle("This is the new title")
   
   $newWorkitem.setDueDate($objectFactory.newDateOnly($dateTool.toDate("yyyy-MM-dd", $newDate)))   
     
   #set( $description = "<h1>This as a description</h1>" )
   $newWorkitem.setDescription($objectFactory.newHtmlText($description))

   #set( $assignee = $projectService.getUser("....userid....."))
   #set( $dummy = $newWorkitem.addAssignee($assignee))

   $wi.save()

#end

$transactionService.commitTx()


Just an example
Maybe this helped


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 12 guests