Java Rally API - 如何查看自定义字段的所有可能值
Java Rally API - how to see all possible values of a custom field
我正在尝试使用集会 REST api 获取自定义字段下拉列表的所有可能值。当我 运行 一个 GET 调用时,我得到的响应只是下拉列表的当前选定值。有什么办法可以查看此自定义字段的所有可能值吗?例如,如果该字段被称为 Foo
,而当前选择的值为 bar1
,我在 JSON 响应中得到的全部是
"c_FOO" : "bar1"
而实际上 Foo
的可能值可能是 bar1
、bar2
等。我现在在代码中所做的只是
GetRequest getReq = new GetRequest("/porfolioitem/12345");
GetResponse getRes = rest.get(getReq);
System.out.print(getRes.getObject());
我会检查这个现有问题:
Querying Allowed values for the possible fields of defects Using Java Rally rest API
基本上,您只需要加载投资组合项类型的类型定义,然后加载其属性集合,找到名为 'c_Foo' 的特定属性,然后加载该属性定义的允许值集合。
还是这个?
restApi.getClient().doGet("/portfolioitem/1234/c_Foo/allowedvalues")
您必须手动解析结果,因为该响应格式不符合标准 wsapi Errors/Warnings/Results 格式。
我明白了。我必须传入项目 ID,因为我工作的工作区有多个项目。所以,借用 Kyle 所做的,
restApi().getClient().doGet("/portfolioitem/1234/c_Foo/allowedvalues?project=project/" + projectId);
我正在尝试使用集会 REST api 获取自定义字段下拉列表的所有可能值。当我 运行 一个 GET 调用时,我得到的响应只是下拉列表的当前选定值。有什么办法可以查看此自定义字段的所有可能值吗?例如,如果该字段被称为 Foo
,而当前选择的值为 bar1
,我在 JSON 响应中得到的全部是
"c_FOO" : "bar1"
而实际上 Foo
的可能值可能是 bar1
、bar2
等。我现在在代码中所做的只是
GetRequest getReq = new GetRequest("/porfolioitem/12345");
GetResponse getRes = rest.get(getReq);
System.out.print(getRes.getObject());
我会检查这个现有问题: Querying Allowed values for the possible fields of defects Using Java Rally rest API
基本上,您只需要加载投资组合项类型的类型定义,然后加载其属性集合,找到名为 'c_Foo' 的特定属性,然后加载该属性定义的允许值集合。
还是这个?
restApi.getClient().doGet("/portfolioitem/1234/c_Foo/allowedvalues")
您必须手动解析结果,因为该响应格式不符合标准 wsapi Errors/Warnings/Results 格式。
我明白了。我必须传入项目 ID,因为我工作的工作区有多个项目。所以,借用 Kyle 所做的,
restApi().getClient().doGet("/portfolioitem/1234/c_Foo/allowedvalues?project=project/" + projectId);