Lookback API: Deleted items

别来无恙 提交于 2019-12-02 06:33:00

问题


I'd like to use the lookback API to view the history of a deleted object, which I think should be simple if I know the formatted id. I just need to query:

{ FormattedID: 'DEXXXX' }

But does the Lookback API record anything special for when an object is deleted (like can I tell exactly when it was deleted or by whom)? Can it help point me to the correct place in the Recycle bin so that I could try to undelete it?


回答1:


Interesting. I just ran a REST query on the Recycle Bin with fetch=true and got back a lot more data on the result set than I'm used to:

GET https://rally1.rallydev.com/slm/webservice/1.40/recyclebinentry/12345678914.js

{ "RecycleBinEntry" : { "DeletedBy" : { "_rallyAPIMajor" : "1",
          "_rallyAPIMinor" : "40",
          "_ref" : "https://rally1.rallydev.com/slm/webservice/1.40/user/12345678910.js",
          "_refObjectName" : "User One",
          "_type" : "User"
        },
      "DeletionDate" : "2012-05-15T02:53:10.087Z",
      "Errors" : [  ],
      "ID" : "DE32",
      "Name" : "Error found in TC43: TC07-011",
      "ObjectID" : 12345678911,
      "Subscription" : { "_rallyAPIMajor" : "1",
          "_rallyAPIMinor" : "40",
          "_ref" : "https://rally1.rallydev.com/slm/webservice/1.40/subscription/12345678912.js",
          "_refObjectName" : "My Subscription",
          "_type" : "Subscription"
        },
      "Type" : "Defect",
      "Warnings" : [  ],
      "Workspace" : { "_rallyAPIMajor" : "1",
          "_rallyAPIMinor" : "40",
          "_ref" : "https://rally1.rallydev.com/slm/webservice/1.40/workspace/12345678913.js",
          "_refObjectName" : "My Workspace",
          "_type" : "Workspace"
        },
      "_CreatedAt" : "May 14, 2012",
      "_objectVersion" : "1",
      "_rallyAPIMajor" : "1",
      "_rallyAPIMinor" : "40",
      "_ref" : "https://rally1.rallydev.com/slm/webservice/1.40/recyclebinentry/12345678914.js",
      "_refObjectName" : "Error found in TC43: TC07-011"
    }
}

I didn't realized Rally released an enhancement to this information, but this data includes the Name and Ref of the User that deleted the Object.

You can walk the Recycle bin of the current Workspace/Project using this REST URL:

https://rally1.rallydev.com/slm/webservice/1.40/recyclebin.js?workspace=/workspace/12345678919&project=/project/12345678920&fetch=true

Where 12345678919 and 12345678920 are the Workspace and Project OIDs, respectively.




回答2:


If you know the specific FormattedID, you can just query for its history, as you mentioned above. There isn't a special indicator that a snapshot represents the last valid state before a deletion, but the _ValidTo date will have been changed from the apoc (9999-01-01) to the date and time it was deleted. Unfortunately, the _User field of that last snapshot will be of the person that caused the last change to the object (before deletion), since we don't record a snapshot for when we delete.




回答3:


Unfortunately Lookback API doesn't provide anything along the lines of tracking deletions or entries in the Recycle Bin. The focus is definitely on Analytics and providing a robust reporting engine for agile metrics.

This doesn't exclude the possibility that at some point LBAPI or other aspects of Rally services could be enhanced with trace-ability and tracking/accountability type of functionality. Enhanced trace-ability in Rally is something customers have expressed a need for and is definitely something that Rally's Product Management team is aware of as a customer need.



来源:https://stackoverflow.com/questions/14843249/lookback-api-deleted-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!