Uploading data from *.csv file to existing project.


I would like to upload multiple issues from existing *.csv file to my YouTrack server. I successfully followed this instructions http://confluence.jetbrains.net/display/YTHB/Import+from+a+CSV+File, but I can't seem to manage uploading Issues to existing project. I would like to be able to do upload a batch on for ex. weekly basis.
Is that possible? If yes, how do I do that?

Comment actions Permalink
Hello, Agata!
Do you get exception, when trying to upload issues? Are there any logs, left after import?
Comment actions Permalink
Hello Anna :)

Thanks for reply!

So this is my command:
python csv2youtrack.py book1.csv http://tapas.mydomain.co.uk myLogin myPassword  IN Incidents

My csv:
Project,Summary,Reporter,Created,Updated,Description,Issue Id,Type,State
Incidents,Summary of test project,Agata Wylegala,24/10/2012,24/10/2012,This is description.,85732497,User Story,New

So the problem is that if I put "Project" field "Incidents" (this is oen of our few existing projects) i get error like this (this is whole console log I'm pasting):

Traceback (most recent call last):
  File "C:\youtrack-rest\python\csv2youtrack.py", line 141, in <module>
  File "C:\youtrack-rest\python\csv2youtrack.py", line 21, in main
    csv2youtrack(source_file, target_url, target_login, target_password)
  File "C:\youtrack-rest\python\csv2youtrack.py", line 36, in csv2youtrack
  File "C:\youtrack-rest\python\csv2youtrack.py", line 47, in import_csv
    self.do_import(projects, new_projects_owner_login)
  File "C:\youtrack-rest\python\youtrackImporter.py", line 25, in do_import
    self._create_project(project_id, project_name, new_projects_owner_login)
  File "C:\youtrack-rest\python\youtrackImporter.py", line 53, in _create_projec
    self._target.createProjectDetailed(project_id, project_name, u'', project_le
  File "C:\youtrack-rest\python\youtrack\connection.py", line 528, in createProj
    'startingNumber': str(startingNumber)}))
  File "C:\youtrack-rest\python\youtrack\connection.py", line 75, in _put
 return self._reqXml('PUT', url, '<empty/>\n\n')
  File "C:\youtrack-rest\python\youtrack\connection.py", line 52, in _reqXml
    response, content = self._req(method, url, body, ignoreStatus)
  File "C:\youtrack-rest\python\youtrack\connection.py", line 45, in _req
 raise youtrack.YouTrackException(url, response, content)
youtrack.YouTrackException: Error for [/admin/project/Incidents?projectName=Inci
dents&projectLeadLogin=root&description=+&lead=root&startingNumber=1]: 400: Bad
Request: {"value":"Index [Project.name] must be unique."}

Is there any way to insert issues to this existing project that I have?
Comment actions Permalink
Hello Agata,

The problem is caused by ProjectID for your project.
Script generates ProjectID 'Incidents' that doesn't match to ProjectID for already existent project.
So, you have to change ProjectID to 'Incidents' while importing. Later you can change it back to previous value.

Please sign in to leave a comment.