Java WebService API

Posts: 15
Joined: Wed Mar 03, 2010 9:46 am

Java WebService API

Postby mberhorst » Thu Mar 04, 2010 12:04 pm

Hallo everybody,

I want to use the Polarion API to create a web service for another system.

The method getWorkItemByIdsWithFields() needs the following parameters:
String projectId
String workitemId
String[] keys

I don't know which keys I can use to call that method.
With which keys I can fill the String array?

Moreover the method queryWorkItems() needs the following parameters:
String query
String sort
String[] fields
In this case the method needs a String array with fields.
But which fields can I use?

Thank you in advance.


Posts: 15
Joined: Mon Dec 07, 2009 9:08 pm

Re: Java WebService API

Postby ChernikovaEkaterina » Mon Mar 08, 2010 11:02 am

Dear Michael,

regarding the method getWorkItemByIdsWithFields():

Gets a work item with only the fields specified filled with values. All other fields are not transmitted.
projectId - the id of the project that contains the workitem to get.
workitemId - the id of the work item to get.
keys - the fields of the work item to fill.

regarding the method queryWorkItems()

The sort parameters is a space separated list of fields to sort the result. You can prefix the field name with a ~ to reverse the sort order. Example: “id ~title”
The field parameter accepts a string array containing a list of fields that should be initialized. Valid names are the fields names of the WorkItem properties.
It is also possible to specify nested fields e.g. to load only the id of assignees of the work items.

String[] fields = new String[] {
"author", "", "linkedWorkItems.LIST.suspect",
"linkedWorkItems.LIST.role" };

Using this as fields parameter for querying WorkItems, would only load the author, name of the assignees, role and suspect of linked WorkItems of all WorkItems.

If you want to avoid specifying the list of initialized fields, you can use queryWorkItemUristo load the URIs of the WorkItems and getWorkItemByUrito load the full WorkItem content.

Best Regards,
Ekaterina Chernikova
Polarion Support

Posts: 15
Joined: Mon Jun 04, 2007 8:58 am
Location: Italy

Re: Java WebService API

Postby pitzalis » Fri Mar 19, 2010 4:33 pm

I use getWorkItemByUri() to load the full WorkItem content, but I have problems reading Work Item custom fields. I tried the getCustomField() but works well only for string custom fileds, not for enumerations. Moreover the application don't know the custom fields type.
Any suggestion?


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 9 guests