RTC - how to reset record id for a project area?
When i created my first work item for the project area, the internal record id is not 1 but rather 1481. Is there a way to reset the record id counter back to 1 for the project area? I want to import the problem tickets using the CSV format but want to retain the original ticket numbers which start at 1.
I'm using the RTC 3.0.1 Eclipse UI client but I haven't come across anything in the UI that allows me to reset the internal record id counter. Is it even possible? The RTC installation I'm using is shared by several other project teams so it seems the record id is being shared across all the projects? I would like the record id to be unique to my project area. If I attempt to import my problem tickets by CSV and set the Id field using my original ticket numbers what is going to happen? Would it overwrite existing work items of the other projects?
Accepted answer
no, you should not be able to overwrite workitems not in your project.
you cannot 'set' the id by import. you CAN update existing workitems in your project with those ID's
Comments
So If I really want to use my original ticket numbers starting at 1 I would need to have a new RTC repository created just for my project?
correct, and sometimes the numbers are not contiguous.. there are cases where canceling creating a workitem will still consume an id value.
generally in migrations like this we suggest adding another field to show the original ID so that its searchable (/old_number in the search box will find old_number in a field)
old number is just for migration.. new workitems wouldn't have this.. so for a short time u deal with both, then just the normal workitem ID
I have thought about using a custom field to store the ticket number from the old system but we do have a number of other documents referring to the old ticket number which I think can easily lead to confusion, at least when viewing historical items. Some of these tickets do have long lifetimes (e.g. several years) as well.
Previously, I found "TN0007: Guide for importing Jazz work items from Bugzilla and other systems (https://jazz.net/library/article/69) although it is somewhat dated now. It didn't address this migration issue.
I'm going to talk to our RTC repo admin to see about setting up another repo just for our project. Thanks for the information.
4 other answers
Comments
Nice tip. Is there an example of setting this up somewhere? Can you override the system wide work item id with the custom ID when displaying work items in query results? That is, do we have edit control over the layout of the query results? If I could hide the system wide id and just show the custom ID in certain query results, this might make it more palatable.
You can control the editor display and the query-results display to show your ID in a very visible place, but the system-defined ID is hardwired into a few critical places like the "search" box and in the work item URLs. So the more prominent you make your ID, the more likely your users are to make the mistake of using your ID in those places where the system-defined ID is expected.
Comments
Thanks Ralph for your valuable input.
Ralph,
I have created workitems with cutsom Ids in RTC i.e 9999* . Able to successfully create the workitem with custom id via CSV import. Now the problem is automatic Id counter has started increasing from 9999* instead of previous value.
Any work around or suggestion to sort out this.
if creation of new workitems in terms of data would be safe ?
I am mot the creator of the extension. As I think it comes with code, I would suggest you understand the code and make it work for you.
Thanks for your quick response !
I have done this via RTC UI using import feature. Didn't use any extension.
Any suggestions ?
If you import CSV and provide the ID and activate updating the items, then the items found by ID are updated. Otherwise leve the ID column out and a new ID is created starting with the last available ID in the repository.
1 vote
I am using create option instead of update and providing a column with name "Id" in csv which have custom Ids.
The result of that csv import - created workitem with custom id provided in excel sheet.
After that I have inserted couple of more values in range of 16** and able to insert .
when creating a workitem without supplying id in the excel sheet it is taking ids of range 9999*.
If longer custom id would cause data corruption ?
To be honest, I don't understand what you are doing, trying to do and what environment you use. If you provide the ID in an import without update mode with CSV, the importer will try to use the ID given (I think as I have done that years ago). If that is already taken it will take an ID that is not, You can't be sure that the work item will actually have the ID. You can update If you provide the ID
To be quite clear here: you don't have any control about the ID that RTC uses for work items beyond what I explained above. You can use a custom attribute as a custom ID, if you want to do some magic and control that value. As explained in this community contributed extension for creating a custom consecutive ID: Extension to generate unique custom work item numbers you can create automation for that as well.
If that does not answer your question, I suggest you open a new question, instead of posting to one that is already answered.
1 vote
PS: RTC will start with the highest given ID fr the next one. If you are not careful, you can run out of ID's if you start with a really big value.