How to retrieve via Web Services API timesheet data of deleted work items ?
search cancel

How to retrieve via Web Services API timesheet data of deleted work items ?

book

Article ID: 57550

calendar_today

Updated On:

Products

Rally On-Premise Rally SaaS

Issue/Introduction

Is there a way to retrieve via Web Services API the data of stories that show as deleted on timesheet?

Resolution

The deleted stories appear in UI grayed out, but the hours are still available via UI and API.

In this example the Timesheet shows S7 before the deletion:

 

and after deletion:

The excerpts of TimeEntryItem queries results below compare the data related to a deleted work item with that of an existing work item. Both the Task and WorkProduct attributes are set to null, but the DisplayString of respective work items and the Count are available. Here is an extract from a deleted story's data:


  • {
    • _rallyAPIMajor: "2",
    • _rallyAPIMinor: "0",
    • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/timeentryitem/<OBJECT_ID>",
    • _objectVersion: "2",
    • CreationDate: "2013-12-05T19:25:47.522Z",
    • _CreatedAt: "27 minutes ago",
    • ObjectID: "<OBJECT_ID>,
    • Subscription: {},
    • Workspace: {},
    • Project: {},
    • ProjectDisplayString: "project1",
    • RevisionHistory: {},
    • Task: null,
    • TaskDisplayString: "TA10: gt2",
    • User: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref:"https://rally1.rallydev.com/slm/webservice/v2.0/user/<USER_OID>",
      • _refObjectName: "API U",
      • _type: "User"
      },
    • Values: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref:"https://rally1.rallydev.com/slm/webservice/v2.0/TimeEntryItem/<OBJECT_OID>/Values",
      • _type: "TimeEntryValue",
      • Count: 1
      },
    • WeekStartDate: "2013-12-01T00:00:00.000Z",
    • WorkProduct: null,
    • WorkProductDisplayString: "S7: g",
    • _type: "TimeEntryItem"
    }




Here is an extract from an existing story's data:

{

    • _rallyAPIMajor: "2",
    • _rallyAPIMinor: "0",
    • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/timeentryitem/<OBJECT_ID",
    • _objectVersion: "1",
    • CreationDate: "2013-12-05T19:17:31.675Z",
    • _CreatedAt: "35 minutes ago",
    • ObjectID: <OBJECT_ID>,
    • Subscription: {},
    • Workspace: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/workspace/<WORKSPACE_OID>",
      • _refObjectName: "NMGMT+7",
      • _type: "Workspace"
      },
    • Project: {},
    • ProjectDisplayString: "project21",
    • RevisionHistory: {},
    • Task: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/task/<TASK_OID>",
      • _refObjectName: "ft1",
      • _type: "Task"
      },
    • TaskDisplayString: "TA7: ft1",
    • User: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/user/<USER_OID>",
      • _refObjectName: "API U",
      • _type: "User"
      },
    • Values: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/TimeEntryItem/<TIME_ENTRY_OID>>/Values",
      • _type: "TimeEntryValue",
      • Count: 0
      },
    • WeekStartDate: "2013-12-01T00:00:00.000Z",
    • WorkProduct: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement/<STORY_OID>",
      • _refObjectName: "f",
      • _type: "HierarchicalRequirement"
      },
    • WorkProductDisplayString: "S6: f",
    • _type: "TimeEntryItem"
    },

 

Another query that uses the undocumented recyclebin endpoint can be used to get the following data about work items in the recycle bin:

ID
ObjectID
DeletionDate
Name
DeletedBy
Type


Please note that undocumented endpoint may stop working without further notice.
Standard rally query parameters such as: (Name = "My Object Name") do not work in the recycle bin, but it is possible to query by deletion date. Thjs query will return data from a worksapce a user is currently logged in to in anther tab of the same browser:

https://rally1.rallydev.com/slm/webservice/v2.0/recyclebin query=(DeletionDate > "2013-01-01")

A workspace can be specified in a query using workspace ObjectID:

https://rally1.rallydev.com/slm/webservice/v2.0/recyclebin workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/<WORKSPACE_OID>

The query returns this data:

{
  • RecycleBinEntry: {
    • _rallyAPIMajor: "2",
    • _rallyAPIMinor: "0",
    • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/recyclebinentry/<OBJECT_OID>",
    • _objectVersion: "1",
    • _refObjectName: "g",
    • ObjectID: <OBJECT_OID>,
    • DeletedBy: {
      • _rallyAPIMajor: "2",
      • _rallyAPIMinor: "0",
      • _ref: "https://rally1.rallydev.com/slm/webservice/v2.0/user/<USER_OID>",
      • _refObjectName: "API U",
      • _type: "User"
      },
    • DeletionDate: "2013-12-05T19:37:05.998Z",
    • _CreatedAt: "57 minutes ago",
    • ID: "S7",
    • Name: "g",
    • Type: "User Story",
    • Errors: [ ],
    • Warnings: [ ]
    }
}
  •