问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/16141512/querying-allowed-values-for-the-possible-fields-of-defects-using-java-rally-rest