1

我有一个关于Polarion JAVA API SDK.

我可以workItem使用:

WorkItem wi = trackerService.getWorkItem(workItemURL);

然后我得到类型:

EnumOptionId type = wi.getType();

现在我怎样才能得到类型表示文本?我可以获得WorkItem使用 API 的图标吗?还有一种方法可以WorkItem从 Polarion 获取所有类型吗?

4

3 回答 3

1

对于您的任务,EnumOptionId 对象具有以下方法(:

.getId()       // returns the Id of this type
.getName()     // returns the human readable name of this type
.getProperty(IEnumOption.PROPERTY_KEY_ICON_URL)   // returns the URL of the Icon of this type

请注意,这些方法也可用于其他枚举类型,如优先级、状态或用户定义的枚举。

于 2020-07-06T06:05:09.287 回答
0

从 WorkItem 获取 EnumOptionId 后。

对于类型名称 -type.getName();

对于图标网址 -type.getProperty("iconURL")

其他要求可以参考下图。 ITypeOpt在此处输入图像描述

常数值

于 2020-10-22T13:02:55.197 回答
0

对于渲染工作项,您可以考虑使用渲染 API。

你可以在 Velocity 中使用类似的东西(你可以在报告页面的脚本块中使用它):

## Get Project Id
#set($projectId = $page.fields().project().projectId())

## Get Work Items with new API
#set($renderWIs = $transaction.workItems().search().query("type:systemrequirement AND project.id:$projectId"))

## Render Work Items
#foreach($WI in $renderWIs)
    $WI.render().withLinks()<br>
#end

查看这篇博客文章解释了差异:https ://polarion.code.blog/2020/06/16/rendering-vs-open-api/

于 2020-09-08T08:00:10.930 回答