我有一个关于Polarion JAVA API SDK
.
我可以workItem
使用:
WorkItem wi = trackerService.getWorkItem(workItemURL);
然后我得到类型:
EnumOptionId type = wi.getType();
现在我怎样才能得到类型表示文本?我可以获得WorkItem
使用 API 的图标吗?还有一种方法可以WorkItem
从 Polarion 获取所有类型吗?
对于您的任务,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
请注意,这些方法也可用于其他枚举类型,如优先级、状态或用户定义的枚举。
对于渲染工作项,您可以考虑使用渲染 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/