brownac brownac - 27 days ago 9
reST (reStructuredText) Question

Java Rally API - how to see all possible values of a custom field

I'm trying to get all possible values for a custom field dropdown using the rally REST api. When I run a GET call, all I get back for the response is the current selected value of the dropdown. Is there I way I can see all the possible values for this custom field? For example, if the field was called

Foo
, and the currently selected value was
bar1
, all I'm getting back in the JSON response is

"c_FOO" : "bar1"


when in reality the possible values of
Foo
could be
bar1
,
bar2
, etc. All I'm doing in code right now is

GetRequest getReq = new GetRequest("/porfolioitem/12345");
GetResponse getRes = rest.get(getReq);
System.out.print(getRes.getObject());

Answer Source

I figured it out. I had to pass in the project ID, since the workspace I work in has multiple projects. So, piggybacking off of what Kyle did,

restApi().getClient().doGet("/portfolioitem/1234/c_Foo/allowedvalues?project=project/" + projectId);