Post

4 followers Follow
0
Avatar

Moving Task Time Entries in Bulk?

Hi All,
 
One of our teams is making some changes to the projects they use to track time related to each customer. I need to find a way to move time entries from existing tasks over to new tasks.
 
As one example, there's currently a task called "Prep" under a milestone called "Reporting." There's another task under that same milestone called "Schedule." They want to move all time logs for that "Schedule" task into the existing task called "Prep," and they want to do that for about 500 instances of that (one for every customer).
 
I'm racking my brain trying to think of some way to do this in bulk and having a hard time with it. They are fine with requiring users to run a Custom Action to accomplish this, FYI. There are several tasks that need to have their time logs moved in this way.
 
I have a Custom Action built at the Timesheet level to move time entries from one task to another that I used elsewhere, but it specifically references the ID of the target task, whereas this will be moving entries to a bunch of different tasks so I can't just hard code the ID of a specific task in this case.
 
Any suggestions? Thanks!
Doug Smith Answered

Please sign in to leave a comment.

7 comments

0
Avatar

Hello Doug,

Timesheets can't be moved, but there's an existing feature request to allow that in the future. Would copying them over and deleting the originals work for you? If so, for a single work item pair, you can copy timesheets this way:

Delete:

Please let me know if this helps.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

Thanks for the suggestion. For the destination $WorkItem, I assume I'd have to use the ID? If so, I'm not sure how to retrieve the ID of the destination task in a CA. The ID will be different for every task within each project, of course. Is there a way to retrieve the ID for a task called "Prep" under the same parent project as the source task, for example? I'm not sure which function(s) would be required to accomplish that. Thoughts?

Doug Smith 0 votes
Comment actions Permalink
0
Avatar

Also: for the $ReportedDate field, what should I enter? I want to just copy the Reported Date of the source time entry over to the destination time entry. I tried entering $ReportedDate = $ReportedDate (which is what I did for the other CA I built on the Timesheet entity), but it did not accept that. It looks like it wants an actual date? I could use $CreatedOn, but that doesn't always = the $ReportedDate.

Doug Smith 0 votes
Comment actions Permalink
0
Avatar

 

Hello Doug,

If one has the ID, a work item can be retrieved using the GetObjectById() function. If not, then there must be a pattern that a custom action can follow, e. g. the destination task is a child of the parent of the source task and its name starts with 'abc'. If there is no such pattern, I would create a custom field to hold the destination task ID on the source task.

You should use TargetObject.ReportedDate to copy the date from source timesheet to destination timesheet.

Please let me know if this helps.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

In most cases, the destination task is indeed a child of the parent of the source task. And the name of the destination task is always known (and it will be the same across all 500+ projects). So what would the logic look like to identify the destination task knowing that it has the same parent as the source task, and knowing exactly what its name is?

I don't know how I would populate a custom field with the ID of the destination task without manually doing it for every single one? If I could build logic to populate a field based on the fact that the destination has the same parent as the source, and based on a known task name, then I think I could use that same logic to just copy over the time entries.

Thanks again!

Doug Smith 0 votes
Comment actions Permalink
0
Avatar

Hello Doug,

The following two actions will create a 'reference to task' variable named 'Destination' and make it equal to a task named 'Destination Task Name', provided such task exists under the parent of the work item the custom action is running on (otherwise it'll remain NULL): 

Please let me know if it works.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

"Timesheets can't be moved, but there's an existing feature request to allow that in the future"

Does this feature exist yet? I have many projects I need to essentially transfer time entries to one single project.

Thanks!

Emily Triyonis 0 votes
Comment actions Permalink