When you move from one bug tracking system to another, the accuracy of the process is very important. A single missing point can make a work item useless. An attached image is often worth a thousand words. Hence, today’s post is about migrating attachments from OnTime to TFS.
NOTE: The samples in this post rely on OnTime SDK, which was replaced by a brand new REST API.
OnTime SDK is a set of web services, and each “area” is usually covered by one or a number of web services. The operations with attachments are grouped in
/sdk/AttachmentService.asmx web service.
So, the first thing to do is to grab all attachments of the OnTime defect:
This method returns a
DataSet, and you’ll have to enumerate its rows to grab the useful data:
1 2 3 4 5 6
Now, let’s take a look at the
GetAttachment method, which actually does the job. It accepts the
DataRow, and returns the TFS
1 2 3 4 5 6 7 8 9 10 11
Couple of things to notice here:
- you have to call another web method to pull binary data of the attachment
- OnTime attachment metadata is rather useful and can be moved as is to TFS, for instance, attachment description
Finally, when a new attachment is added to the TFS work item, “increment” the
ChangedDate of the work item before saving it. The TFS server often refuses saving work item data in case the previous revision has exactly the same date/time stamp. Like this (always works):
Hope it’s useful. Good luck!