使用 Java Rally rest API 查询可能的缺陷字段的允许值 [英] Querying Allowed values for the possible fields of defects Using Java Rally rest API
问题描述
我需要检查该字段是否具有允许的值,如果是,则需要使用 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
推荐答案
您可以查询 TypeDefinition 类型.在您的提取中包含 Attributes 和 AllowedValues.
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);
查看 WSAPI 文档 中的 TypeDefinition、AttributeDefinition 和 AllowedAttributeValue 对象以获得要在每个字段上获取的可用字段的完整列表.
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.
这篇关于使用 Java Rally rest API 查询可能的缺陷字段的允许值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!