Wiki page - find a custom field value

Description
JulienE
Posts: 7
Joined: Thu Jun 20, 2013 2:45 pm

Wiki page - find a custom field value

Postby JulienE » Thu Nov 30, 2017 10:42 am

Hi there,

I have a workitem (id: "fonction") with a custom field (id: "idQC").

In a classic wiki page, I would like to find the value of the custom field idQC and write it in a variable, to be able to reuse it later.

How can I achieve this?

Here is a first step I've made:

Code: Select all

#set ($project_id = $page.getSpace().getProjectId())

#set($items = $trackerService.queryWorkItems("type:fonction AND project.id:$project_id", "id"))

#foreach($item in $items)
   #set ($itemID = $item.getId())
   #set $itemidQC = ???????????????????????????????????
##end


Maybe it is not the right direction. I can get the ID of the item, but I don't know how to get the value of its custom field.

Thanks for your help and answers.

Best,

ALMighty
Posts: 80
Joined: Wed Apr 27, 2016 10:34 am
Location: Austria

Re: Wiki page - find a custom field value

Postby ALMighty » Tue Dec 19, 2017 2:20 pm

Hello!

This is done by

Code: Select all

 #set ($itemID = $item.getId())
 #set $itemidQC = $item.getCustomField("idQC")


Here you can find the Javadoc of the WorkItem class : https://almdemo.polarion.com/polarion/s ... kItem.html
(this is for the Polarion ALM only, for the API which you can invoke in Java of the ALM you can find it here)

by the way you have written
I have a workitem (id: "fonction") with a custom field (id: "idQC").


But you actually meant type: fonction (see your query). :wink:
---------------------------------------------------------------------------------------------------
Playing a good game is never lame. :D
Image


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 11 guests