It's all about the answers!

Ask a question

Update of work items during import results in duplicate work items being created.


Alfred Hussein (111) | asked Mar 06 '17, 10:41 a.m.

 We currently are on RTC 6.0.3. We are using Eclipse to do the import/export and we are importing/exporting to a CVS file.


We have two geographical separate RTC Instances where we want to import work items from the source RTC instance to the target RTC instance.

According to the documentation, I should be able to update work items, but I have had no luck in doing this, so I not sure what I am doing wrong.

Whenever I do the import from the source, I end up getting new work items that results in duplicates, rather than updated work items from the import.

Here is the help text that seems to imply I can update exiting work items during an import, rather than duplicating them:

Procedure

  1. Click File > Import. In the Import window, click Team > Work Items from CSV. Click Next.
  2. Click Browse and select the CSV file to import. Select to separate the values in the CSV file by tabs, commas, or something else. If you use a separator other than tabs or commas, click Other and enter the separator in the adjacent field.
  3. Select the project area in which to create or update the work items based on the contents of the CSV file.
  4. Select to create or update work items.
    • To create work items, select Create a new Work Item.
    • To update existing work items, select Update matched Work Item. To be able to update existing work items, the CSV file must contain a column for the work item ID (usually Id). The Import Work Items wizard uses the IDs to find matching work items.

To create work items for records that do not have matching existing work items, select Create a new work item for unmatched entry.

https://www.ibm.com/support/knowledgecenter/SSJJ9R_6.0.3/com.ibm.team.workitem.doc/topics/t_importing_work_items_csv_file.html

Here is the help text for the export:

Important

If you intend to use the Import wizard to update existing work items, be sure to include the ID attribute in the exported CVS file and set its Show column setting to use the internal representation (Internal Value). The Import wizard uses the IDs to find the work items to update.

  • In the Show column setting, specify whether to use the internal (Internal Value) or external (Label) representation of each attribute value. Change the Show column value by clicking the value and selecting the option from the menu that opens. The external representation is how the value is displayed in the work item editor. The internal representation is a value that can be processed by the spreadsheet. This value might be less readable for users. For example, the external value of the Estimate attribute is in hours or days. The internal representation is in milliseconds

https://www.ibm.com/support/knowledgecenter/SSJJ9R_6.0.3/com.ibm.team.workitem.doc/topics/t_exporting_work_items.html

So the first question is what am I doing wrong, and the second question is whether RTC can in fact just update existing work items rather than creating new ones.

Any help would be appreciated.

Thanks

Al  

2 answers



permanent link
Ralph Schoon (63.6k33647) | answered Mar 06 '17, 11:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Question 1: Since you don't provide anything that would allow to, there is no way to tell you what you are doing wrong.

Question 2: RTC can update existing work items during import. In order to do so, it is necessary to provide the ID of the work item as a column in the import.

The last user that asked this particular question some weeks ago, failed to provide the necessary information to RTC to understand what the ID column was. Note: the ID of the Id attribute is "id" - all small letters. You could try to put the attribute ID's in the column headers, so the ID column should show id. The better approach is to create a mapping file and define the mapping of the incoming columns to the attributes.


Finally, note that using CSV import/export across repositories to synchronize them is, as far as I can tell, not a great idea. As far as I can tell, this will immediately break as soon as users start creating work items. they will get the next available ID on each site and you will most certainly end up with having conflicting information.


permanent link
Alfred Hussein (111) | answered Mar 06 '17, 3:21 p.m.

Thanks for the reply.

I was not sure what you are looking for in Question 1 since it looks like some of the text is missing, but I will hazard a guess that you are suggesting I put in some examples of what I am trying to do?

Here is a fragment of the cvs file that I exported using the Eclipse Export Wizard that was used to import into the target RTC. I have only included the first few fields, but it includes the ID column, which sounds from your response is the key one needed for the updates to occur.

Type

Id

Status

com.ibm.team.workitem.workItemType.feature

11222

com.ibm.team.workitem.feature.state.draft

com.ibm.team.workitem.workItemType.feature

11216

com.ibm.team.workitem.feature.state.draft

com.ibm.team.workitem.workItemType.feature

11223

com.ibm.team.workitem.feature.state.draft

Here is an image of showing the update parameters set in the Eclipse export wizard:

Here is a image of the export window that was used to decide on which fields to export:

 

I chose to export the Id of the work item and to use the Internal Value instead of the labels since the RTC Help files stated that this was the better approach when wanting to update work items at a target. The import did create a ID column and populated it with Id numbers.

I am not really clear on your suggestion about renaming the ID of the Id attribute to "id", all small letters. Are you suggesting I change the column name in the excel spreadsheet manually? I did try that, but got an import error so I may have guessed incorrectly.

I did try using the default mapping file, but it still created duplicates and not an update. My understanding of the mapping file was to use it when you had fields that may mismatch between the source and target. In our case, the work items are identical.

Should I be using the import/export wizard in Eclipse, is there an alternative to doing this importing and updating work items in the target RTC.

Al


Comments
Alfred Hussein commented Mar 06 '17, 3:22 p.m.

My apologies, the images I inserted did not come across.

Al


Ralph Schoon commented Mar 06 '17, 5:02 p.m. | edited Mar 06 '17, 5:02 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your reputation is not high enough for images. Try "id" and not Id as the column header or provide a mapping file.

A default mapping file does not make sense. The generated one is only an example. you have to edit it to make the mapping work.


Ralph Schoon commented Mar 07 '17, 2:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The mapping file is a general mechanism to map from the input attributes and values to the output attributes and values. It makes sure that the input attribute ID and the output attribute ID are mapped. In any case in your case I suspect that the import does not recognize the ID attribute column of the  import file and thus can not localize the existing work item.  

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.