user2285553
user2285553

Reputation: 125

Querying Allowed values for the possible fields of defects Using Java Rally rest API

I need to check if the field is having allowed values, if so need to get all the allowed values from the system using Java Rally rest API for eg : check if severity is having allowed values, if yes get the allowed values such as major problem, minor problem etc from the Rally

Upvotes: 2

Views: 1078

Answers (1)

Kyle Morse
Kyle Morse

Reputation: 8410

You can query against the TypeDefinition type. Include Attributes and AllowedValues in your fetch.

QueryRequest defectTypeRequest = new QueryRequest("typedefinition");
defectTypeRequest.setFetch(new Fetch("Attributes,Name,AllowedValues,StringValue"));
defectTypeRequest.setQueryFilter(new QueryFilter("TypePath", "=", "defect"));
QueryResponse queryResponse = restApi.query(defectTypeRequest);

Check out the TypeDefinition, AttributeDefinition and AllowedAttributeValue object in the WSAPI docs for a full list of the available fields to be fetched on each.

Upvotes: 2

Related Questions