It's all about the answers!

Ask a question

Work Item Command Line: Unable to upload attachments while creating Work items


Vijayalaxmi B (132) | asked Oct 15 '20, 1:03 a.m.
edited Oct 15 '20, 8:53 a.m. by Ralph Schoon (60.7k33643)

 Hello Team,

I am trying to import a csv file which contains workitems to Jazz.
Attachments folder is having the folders with ID.
csv contains an attachment column with the row ./Attachments/25207272/safe.png

WCL :
-importworkitems /importdebug password=”” /skipEmailNotification projectArea=”Migration from MKS” /ignoreemptycolumnvalues importFile=”SAFE_attachments.csv” repository=”” user=”” mappingFile=”sample_mapping.xml” encoding=”UTF-8″ delimiter=”,”

Mapping.xml
sourceId=”Attachments” targetId=”com.ibm.team.workitem.linktype.attachment.attachment”/>

The workitem is created but without attachments.
No matching attribute found: ‘com.ibm.team.workitem.section.attachments

How can I create the WI with atatchments? Any configuration I am missing here in the WCL?


Comments
Ralph Schoon commented Oct 15 '20, 1:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
How does your CSV file look like?
I have usually tried to do this based on an export from EWM/RTC to be sure. It is not necessary to use a mapping file.

The import complains about com.ibm.team.workitem.section.attachments. This does not look like the ID of the attachments attribute. This looks like the name of the editor presentation. Where did you get that ID?

Vijayalaxmi B commented May 18 '21, 6:36 a.m.

Hello Ralph,

Thank you for the answer. It helped for until Jazz version 7.0 .Is there WCL update for Jazz 7.0.x ? I am facing issue with attachments while importing. Getting the below exception. I am using WCL 5.3.1. The  mapping file worked for Jazz 7.0.

Now facing issue with Jazz 7.0.2. Can you please help

Item id and State id must not be null
CRJAZ2796E Details about the error were written to the server log file. To find this data, search the log file for this identifier: E56CBD90FF0545D32B01B3AD554CF84CA523212C.


Ralph Schoon commented May 18 '21, 7:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Have you tried to download and provide the 7.0.2 Plain Java Client Libraries  to WCL, when trying to use it against a 7.0.2 server? I updated the Readme with prerequisites.


Vijayalaxmi B commented May 18 '21, 8:45 a.m.

 I updated PlainJava Client libraries with 7.0.2 and it worked :)

Thank you so much for the quick reply


Ralph Schoon commented May 18 '21, 9:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Glad to hear that. 

Please open a new question next time though and do not comment on a resolved existing question, thanks. 

Accepted answer


permanent link
Ralph Schoon (60.7k33643) | answered Oct 15 '20, 8:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The importer uses the pseudo attribute name/id "Attachments" or "attachments" to identify the attachments column in the CSV. com.ibm.team.workitem.section.attachments or the mapping com.ibm.team.workitem.linktype.attachment.attachment make no sense.

I would suggest you run an export e.g.
wcl -exportworkitems /ignoreErrors repository="https://clm.example.com:9443/ccm" user=myadmin password=myadmin projectArea="JKE Banking (Change Management)" exportFile="C:\Temp\20201015_Export\Test.csv" query="All" columns="workItemType,summary,Attachments" delimiter=;

    
and look at what you get. With respect to using the mapping, I can not really tell how that would look like for attributes at the moment. I would assume that the RTC/EWM side would require to use the attribute name/id 
"Attachments" or "attachments".

Vijayalaxmi B selected this answer as the correct answer

Your answer


Register or to post your answer.