Problems with csv2youtrack importer

I am having some problems with this script, hopefully somebody can help me here.

First problem is that it tries to create a subsystem even if it already exists in which case it fails. It would be much more helpfull to check first and create only if it's not there!

Second problem is much more serious because it does not actually import any issues and fails with the following:


[14:21:48] dmitry:~/youtrack-remote-api/python $ python csv2youtrack.py http://youtrack.jetbrains.net [user password projectid projectname csvfile]
Traceback (most recent call last):
  File "csv2youtrack.py", line 378, in 
    main()
  File "csv2youtrack.py", line 23, in main
    csv2youtrack(target_url, target_login, target_password, project_id, project_name, csv_file_path)
  File "csv2youtrack.py", line 216, in csv2youtrack
    print target.importUsers(users_to_import)
  File "/Users/dmitry/youtrack-remote-api/python/youtrack/connection.py", line 185, in importUsers
    return self._reqXml('PUT', '/import/users', xml, 400).toxml()
  File "/Users/dmitry/youtrack-remote-api/python/youtrack/connection.py", line 47, in _reqXml
    response, content = self._req(method, url, body, ignoreStatus)
  File "/Users/dmitry/youtrack-remote-api/python/youtrack/connection.py", line 40, in _req
    raise youtrack.YouTrackException(url, response, content)
youtrack.YouTrackException: Error for [/import/users]: 403: Forbidden: You must be administrator.

I am administrator for this project, in fact this script creates a subsystem just fine, but for some reason it fails on importing issues.

Any ideas?

Thanks!

0
7 comments

I meant that I am admin for this project I am trying to import into. I am not admin for this youtrack installation (whatever it means).

0
Avatar
Permanently deleted user

Hello, Dmitry.

To import users and issues you must be admin of youtrack instance.

0

Is it possible to somehow import issues without being admin of an instance?

I mean I can create issues manually, why I cannot import it from a file? What is the rationale of not allowing that? Thanks!

0
Avatar
Permanently deleted user

When you import issues, you are not just creating them, you are setting such proprties as reporter, updater and so on, which you can't set when you just create issues. Also, if you are not admin, you can't create users.

0

Well, all I actually want is to somehow create lots of issues/tasks in youtrack. I figured that the simplest way would be to put all my issues into csv file and then to import them all at once. I don't want to create any users (I assign to existing ones), in fact I don't need to create anything else beside those issues, I already have in my project everything I need (subsystems) etc.

Can you please suggest some way to do that? Creating all those issues manually one by one is very tedious and time consuming, but this import script seemed to be the answer, unfortunately it does not work in this case.

Can this script be modified to accomplish what I need or this is just not possible with the current version? Thanks!

0
Avatar
Permanently deleted user

Yes, you can modify script, that it will post issue instead of importing it.

0
Hey there,

Sorry for reviving such an old thread, but I ran into the exact same issue today. I am not an administrator and want to create new issues from a *.csv file. Could you help me figure out what parts of the script I'd have to modify?

Thanks! :)
0

Please sign in to leave a comment.