It's all about the answers!

Ask a question

How do I change the creation date of a workitem?


David Coles (111) | asked Oct 22 '12, 8:03 p.m.
 Hello,

How can I change the creation date of an existing work item?
We've migrated a lot of 'work' from a previous system in to RTC but all of the creation dates of the new WorkItems are from the day when the auto migration occurred. We would like to change these to be the date when the original work was created but I can't see a way to change things.
I can query the work item using the java api and then call setCreationDate on the IWorkItem object but it doesn't seem to change the date and it's marked as 'Internal' in the api docs. Should this work? is there a way change the creation date?

Thanks
David

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Oct 23 '12, 3:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi David,

I believe you can do that only using an API. You can use the plain java Client Libraries to do that.
Using the Plain Java Client Libraries you could use:
 
workItem.setCreationDate(timestamp);

I should probably create a better entry, but some hints on how to modify a work item can be found in this post: http://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/ .  You can do the modification in the operation execute instead of uploading the attachment. For example

@Override
protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor) throws TeamRepositoryException {
try {
IWorkItem workitem = workingCopy.getWorkItem();
workitem.setCreationDate(timestamp);
} catch (IOException e) { e.printStackTrace(); }
}

permanent link
Arun Batra (14612427) | answered Oct 23 '12, 5:39 a.m.
One option to do so would be to make the creation date attribute as editable from the process configuration source. (as it cannnot be done from the editor presentations directly.) The next step would be to synchronize all workitems so that the change is updated. Then one could go ahead and change the creation date of the synchronized workitems.

Hope it helps...



Comments
praveen patidar commented Dec 02 '12, 11:53 p.m.

Just FYI...
One other way is to Export the workitems with Creation date and update the creation date and import them again. Its simple and required less technical effort.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.