亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 Java Rally Rest API 提取 Rally 缺陷討論

使用 Java Rally Rest API 提取 Rally 缺陷討論

大話西游666 2022-12-21 16:47:54
我正在嘗試創建一個簡單的 Java 腳本,它將連接到 Rally,獲取所有缺陷并返回缺陷詳細信息,包括作為 Java 對象的討論。這里的問題是討論作為我認為的集合返回,因為只給出了一個 URL。我堅持如何將缺陷的討論作為 JSON 中的對象返回,而不是僅返回另一個必須單獨運行的查詢(我假設有數千次,因為我們有數千個缺陷)。這是我的代碼:import java.io.IOException;import java.net.URI;import java.net.URISyntaxException;import com.google.gson.JsonArray;import com.google.gson.JsonElement;import com.google.gson.JsonObject;import com.google.gson.JsonParser;import com.rallydev.rest.RallyRestApi;import com.rallydev.rest.request.GetRequest;import com.rallydev.rest.request.QueryRequest;import com.rallydev.rest.request.UpdateRequest;import com.rallydev.rest.response.QueryResponse;import com.rallydev.rest.util.Fetch;import com.rallydev.rest.util.QueryFilter;import com.rallydev.rest.util.Ref;import org.json.simple.JSONArray;public class ExtractData{    public static void main(String[] args) throws URISyntaxException, IOException, NumberFormatException    {        RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"), "apiKeyHere");        restApi.setProxy(URI.create("http://usernameHere:passwordHere0@proxyHere:8080"));        restApi.setApplicationName("QueryExample");        //Will store all of the parsed defect data        JSONArray defectData = new JSONArray();        try{            QueryRequest defects = new QueryRequest("defect");            defects.setFetch(new Fetch("FormattedID","Discussion","Resolution"));            defects.setQueryFilter(new QueryFilter("Resolution","=","Configuration Change"));            defects.setPageSize(5000);            defects.setLimit(5000);        }    }}=如您所見,討論將作為 URL 返回,而不是獲取實際討論。由于此查詢將在運行時使用,因此我更喜歡整個對象。
查看完整描述

1 回答

?
狐的傳說

TA貢獻1804條經驗 獲得超3個贊

不幸的是,沒有辦法在一個請求中獲取所有這些數據——您必須為您閱讀的每個缺陷加載 Discussion 集合。還要注意,最大頁面大小為 2000。

這與您嘗試做的并不完全相同,但此示例顯示了加載子故事,就像您加載討論一樣......

https://github.com/RallyCommunity/rally-java-rest-apps/blob/master/GetChildStories.java#L37


查看完整回答
反對 回復 2022-12-21
  • 1 回答
  • 0 關注
  • 83 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號