2017-06-02 25 views
0
JsonObject newTS = new JsonObject(); 
newTS.addProperty("Workspace", "/workspace/25194919975"); 
newTS.addProperty("Name", "name"); 
newTS.addProperty("Project", "/project/81223493876"); 
newTS.addProperty("Tags", tagName); 
newTS.addProperty("Release.Name", releaseID); 
newTS.addProperty("Iteration.Name", iterationID); 
newTS.addProperty("projectScopeUp", false); 
newTS.addProperty("projectScopeDown", true); 
newTS.addProperty("fetch", true); 
newTS.addProperty("rankTo", "BOTTOM"); 
newTS.add("TestCases", testCaseList); 

CreateRequest createRequest = new CreateRequest("testset",newTS) 
CreateResponse createResponse = restApi.create(createRequest); 

結果:java的反彈API,不能在特定迭代來創建測試集和釋放,在不定期迭代越來越創建

{"CreateResult": { "_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": ["It is no longer necessary to append \".js\" to WSAPI resources.", "Ignored JSON element testset.Tags.Name during processing of this request.", "Ignored JSON element testset.Release.Name during processing of this request.", "Ignored JSON element testset.Iteration.Name during processing of this request.", "Ignored JSON element testset.projectScopeUp during processing of this request.", "Ignored JSON element testset.projectScopeDown during processing of this request.", "Ignored JSON element testset.fetch during processing of this request.", "Ignored JSON element testset.rankTo during processing of this request."] 
+0

能幫會並欣賞 – bhamo02

回答

0

當然,你只需要設置迭代和對象引用,而不是釋放按名稱 - 就像你在項目中一樣。

newTS.addProperty("Iteration", "/iteration/12345"); 
newTS.addProperty("Release", "/release/23456"); 

其他一些東西,以及:

設置projectScopeUpprojectScopeDown有一個創建無影響。

fetch應在要求進行設置:

createRequest.setFetch(new Fetch("true")); 

rankTo應該作爲對請求設置了一個param:

createRequest.addParam("rankTo", "Bottom"); 
+0

嗨凱爾,感謝您的快速resonse 我收到以下錯誤 錯誤: 無法從「/ release/release 2.2」解析對象引用 – bhamo02

+0

A ref的格式爲/ /。看起來你還在指定名字...... –