It's all about the answers!

Ask a question

CSV Import to custom attribute enum doesn't quite finish

sam detweiler (12.5k6185201) | asked Feb 19 '14, 9:15 a.m.
 I need to import some data from another system.. export, csv looks great.

defined the enum on rtc 4.0.4, 
   <enumeration attributeTypeId="" name="Test Phase">
       <literal default="true" externalValue="" icon="processattachment:/enumeration/unassigned2.gif" id="" name="Unassigned" null="true"/>
       <literal externalValue="" id="" name="Design"/>
       <literal externalValue="" id="" name="Dev"/>
       <literal externalValue="" id="" name="QA"/>
       <literal externalValue="" id="" name="UAT"/>
       <literal externalValue="" id="" name="Perf"/>
       <literal externalValue="" id="" name="Pen"/>
       <literal externalValue="" id="" name="PreProd"/>
       <literal externalValue="" id="" name="Prod"/>

and variable to hold it. 

       <customAttribute id="" name="Test Phase" type=""/>
added the field to the mapping file,
<attribute sourceId="Test Phase" targetId=""/>

the data imports, but each record shows a red x next to this field.
I can drop down, then select some other value (they are in the list), then reselect the 'bad' value and save the workitem and its happy. 

the data in the file is 'QA', 'UAT', 'Dev'

this also happens to another enum based field on the same workitem.. defined the same way.
has an 'external value' which contains similar style data

sam detweiler commented Feb 19 '14, 10:10 a.m.

the csv input is tab separated and it does not 'appear' that there are any spurious whitespace chars

sam detweiler commented Feb 20 '14, 6:38 a.m.

bump to the top.. do I need to engage support?  need to have a resolution by Friday night.

Accepted answer

permanent link
Lily Wang (4.9k714) | answered Feb 20 '14, 7:00 a.m.
Hi Sam,
For the mapping file, you need to set as below for each value:
<attribute sourceId="Test Phase" targetId="">
  <value sourceId="UAT" targetId=""/>
  <value sourceId="QA" targetId=""/>

sam detweiler selected this answer as the correct answer

Lily Wang commented Feb 20 '14, 7:02 a.m.

Woops! Paste again:

<attribute sourceId="Test Phase" targetId="">                     <value sourceId="UAT" targetId=""/>
            <value sourceId="QA" targetId=""/>

sam detweiler commented Feb 20 '14, 7:07 a.m. | edited Feb 20 '14, 7:51 a.m.


the need for these two custom enum attributes came in after I made the mapping file, and I made some assumptions on the format and processing using the mapping file.

thanks again for helping make this next step successful.

sam detweiler commented Feb 20 '14, 6:45 p.m.

It was a lot easier  to make this correction than I expected..

I started an import and told it to create the mapping file..
then edited the mapping, extracted the content for the two variables into my mapping file..

Lily Wang commented Feb 20 '14, 6:57 p.m.

Exactly. The "Save Default As ..." link generates the mapping file using your project process configuration, and the "Compute from Data" generate a file using the csv data. You only need to map the IDs and values of the two files.

Your answer

Register or to post your answer.