modify WI within widget or WIKI page

Description
SemiOk
Posts: 1
Joined: Fri Mar 17, 2017 10:40 am

modify WI within widget or WIKI page

Postby SemiOk » Fri Mar 17, 2017 2:05 pm

Hi,

i'm trying to manipulate WorkItems attached hyperlink. I have to replace a servername by another one.
I'm able to list up all the hyperlinks that should be modified.
To change the hyperlinc i'm using the following:

Code: Select all

  ##  allowed ?     
  #if (!$transactionService.canBeginTx())
    ##  - start transaction
    #set ($void = $transactionService.beginTX())
    ##  - remove old hyperlink
    #set ($void = $wi.removeHyperLink($hl.Uri) )
    ##  - modify Uri
    #set ($newUri = $hl.Uri.replace($oldText,$newText))
    ##  - add new hyperlink to WI
    #set ($void = $wi.addHyperlink($newUri, $hl.Role) )
    ##  - save WI
    #set ($void = $wi.save() )
    ##  - terminate transaction
    #set ($void = $transactionService.commitTx())
  #else
    no transaction allowed reload page
  #end ## transaction


This code used within a report page in a <Script block> the error "save() is not allowed within readonly transaction"

This code use within a old Wiki-page always prints "no transaction allowed reload page".

Has anyone a hint where the problem is? Is my user (or the one from the widget) missing some rights?

thanks

Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 2 guests