Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

CSV Import to custom attribute enum doesn't quite finish

 I need to import some data from another system.. export, csv looks great.

defined the enum on rtc 4.0.4, 
   <enumeration attributeTypeId="com.xxx.workItem.enumeration.testphase" name="Test Phase">
       <literal default="true" externalValue="com.xxx.workItem.enumeration.testphase.unassigned" icon="processattachment:/enumeration/unassigned2.gif" id="com.xxx.workItem.enumeration.testphase.literal.l2" name="Unassigned" null="true"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.design" id="com.xxx.workItem.enumeration.testphase.literal.l4" name="Design"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.dev" id="com.xxx.workItem.enumeration.testphase.literal.l6" name="Dev"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.qa" id="com.xxx.workItem.enumeration.testphase.literal.l8" name="QA"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.uat" id="com.xxx.workItem.enumeration.testphase.literal.l10" name="UAT"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.perf" id="com.xxx.workItem.enumeration.testphase.literal.l12" name="Perf"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.pen" id="com.xxx.workItem.enumeration.testphase.literal.l14" name="Pen"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.preprod" id="com.xxx.workItem.enumeration.testphase.literal.l16" name="PreProd"/>
       <literal externalValue="com.xxx.workItem.enumeration.testphase.prod" id="com.xxx.workItem.enumeration.testphase.literal.l18" name="Prod"/>
   </enumeration>

and variable to hold it. 

       <customAttribute id="com.xxx.workItem.attribute.testphase" name="Test Phase" type="com.xxx.workItem.enumeration.testphase"/>
added the field to the mapping file,
<attribute sourceId="Test Phase" targetId="com.xxx.workItem.attribute.testphase"/>
import..

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

0 votes

Comments

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

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


Accepted answer

Permanent link
Hi Sam,
For the mapping file, you need to set as below for each value:
<attribute sourceId="Test Phase" targetId="com.xxx.workItem.attribute.testphase">
  <value sourceId="UAT" targetId="
com.xxx.workItem.enumeration.testphase.literal.l10"/>
  <value sourceId="QA" targetId="
com.xxx.workItem.enumeration.testphase.literal.l8"/>
</attribute>

sam detweiler selected this answer as the correct answer

2 votes

Comments

Woops! Paste again:

<attribute sourceId="Test Phase" targetId="com.xxx.workItem.attribute.testphase">                     <value sourceId="UAT" targetId="com.xxx.workItem.enumeration.testphase.literal.l10"/>
            <value sourceId="QA" targetId="com.xxx.workItem.enumeration.testphase.literal.l8"/>
</attribute>

Thanks.

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.

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..
done..


1 vote

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,014

Question asked: Feb 19 '14, 9:15 a.m.

Question was seen: 4,982 times

Last updated: Feb 20 '14, 6:57 p.m.

Confirmation Cancel Confirm