I just deleted a task using the Rally website, but when a search for task using the REST API it doesn't return it. I assumed that it should return with the flag "Recycled".
Can anybody help me?
Regards, Paulo
虽然并不理想,但您可以通过此 REST 端点访问回收站:
https://rally1.rallydev.com/slm/webservice/1.40/recyclebin.js?workspace=/workspace/12345678910&project=/project/12345678911
其中长整数是感兴趣的工作区和项目 OID。
回收站条目如下所示:
{
_rallyAPIMajor: "1",
_rallyAPIMinor: "40",
_ref: "https://rally1.rallydev.com/slm/webservice/1.40/recyclebinentry/12345678910.js",
_refObjectName: "Test Case 3: Load in, run Analysis on Integer Grids",
_type: "RecycleBinEntry"
}
回收站 OID 是唯一的,并且与被删除的工件的 OID 不同,因此没有一个很好的方法可以将回收站条目映射到被删除的工件以创建它。对象名称可以工作,尽管您冒着重复的风险。回收站条目也具有与 UI 中的回收站相同的限制 - 子对象不显示/不可访问。
如果您想从 .NET 访问回收站,这里有一个简单的示例:
namespace RestExample_QueryRecycleBin {
class Program
{
static void Main(string[] args)
{
//Initialize the REST API
RallyRestApi restApi;
String userName = "user@company.com";
String userPassword = "topsecret";
// Set Rally parameters
String rallyURL = "https://rally1.rallydev.com";
String rallyWSAPIVersion = "1.40";
//Initialize the REST API
restApi = new RallyRestApi(userName,
userPassword,
rallyURL,
rallyWSAPIVersion);
// Specify workspace and project
string myWorkspace = "/workspace/12345678910";
string myProject = "/project/12345678911";
//Query for items
Request request = new Request("recyclebinentry");
request.Workspace = myWorkspace;
request.Project = myProject;
QueryResult queryResult = restApi.Query(request);
foreach (var result in queryResult.Results)
{
//Process item
string itemName = result["_refObjectName"];
string itemRef = result["_ref"];
Console.WriteLine(itemRef + ", " + itemName);
}
Console.ReadKey();
}
}
}
这是 WSAPI 中的一个不一致之处。不幸的是,所有查询都是隐式范围的(Recycled = false),因此任何已删除的内容都不会从工件端点返回。也无法通过 WSAPI 访问回收站的内容。
我鼓励您在https://ideas.rallydev.com/ideas/D2374为这个功能的想法投票。