Page 1 of 1

Java WebService API

Posted: Thu Mar 04, 2010 12:04 pm
by mberhorst
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.

regards
Michael

Re: Java WebService API

Posted: Mon Mar 08, 2010 11:02 am
by ChernikovaEkaterina
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.

Example:
String[] fields = new String[] {
"author", "assignee.LIST.name", "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

Re: Java WebService API

Posted: Fri Mar 19, 2010 4:33 pm
by pitzalis
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?

Thanks,
Giuseppe