import attaches in youtrack

I am writing a script for migrating from Redmine to Youtrack. All tasks, users and the status of transported fine, but I have a problem with the transfer of attachment files.Could you give an example of how a Python Client Library can attach a local file on issue? In the Import REST API is very little information on the subject.

Comment actions Permalink

Hello, Alexey!

You can see the example in Here it is:

print "Processing attachment [ %s ]" % attach.filename

            if not (attach.author_name in registered_users):

                yt_user, registered_users = process_non_authorised_user(target, registered_users, attach.author_name)

                if yt_user is None :

                    attach.author_name = "guest"


                    attach.author_name = yt_user

            content = open(urllib.quote(attach.filename))

            target.createAttachment(str(project_ID) + "-" + str(, attach.filename, content, attach.author_name,


In the example above attach.filename is name of the file on disk.

Comment actions Permalink

Hello Alexey,

Our team would be very grateful if you could provide us your script for testing and further including it to our import library. Please let us what you think.

Thanks in advance!


Please sign in to leave a comment.