2013-06-27 115 views
3

我正在使用.NET API。完成後,我的意思是這樣一個JSON one(已經格式化了,我認爲它需要憑證才能看到它inside the webservice)。使用Rally REST API,如何查詢並返回* complete * JSON對象?

當我實例化Request對象時,這只是添加更多字段來獲取的問題?

Request storyRequest = new Request("hierarchicalrequirement") 
     { 
      /* Fields to Fetch*/ 
      Fetch = new List<string>() { "Name", "FormattedID", "Children", "Owner", "ScheduleState" }, 
      // keep adding field here... 

      /* Add a query - quering the US with ID equals to '_formattedID'*/ 
      Query = new Query("FormattedID", Query.Operator.Equals, _formattedID) 
     }; 

在此先感謝!

編輯 我想查詢用戶故事ID,以防萬一它不明確。

+0

我想這只是一個離開Fetch空的問題... Fetch = new List (){};對不起虛擬問題 –

+0

好找!你願意將你的評論添加爲答案嗎?這樣其他人更容易找到。謝謝! – 2013-06-27 14:20:04

+0

當然,爲什麼不! –

回答

2

在構建請求時,應該過濾要在Fetch屬性中獲取的字段。

的關鍵:

_rallyAPIMajor 
_rallyAPIMinor 
_ref 
_objectVersion 
_refObjectName 

總是被要求任何回報。您可以將Fetch保留爲空,並返回所有45個鍵(45表示「層次要求」),或者可以過濾所需的鍵。

相關問題