|Before you begin:|
To import issues from Trac:
- Download the latest version of YouTrack's Python Client Library and unzip it.
- Create a mapping between Trac project and target YouTrack project. See sample mapping in the defaultTrac.py file.
- Import your mapping into trac2youtrack.py. By default, the defaultTrac.py mapping scheme will be used.
- From the Python Client Library installation directory, execute the following command:
The following command line parameters should be provided:
Parameter Description target_url YouTrack URL target_login YouTrack admin user login target_password YouTrack admin user password project_ID YouTrack Project ID project_name YouTrack Project Name path_to_trac_environment the path to the Trac project
- Importing Trac Users:
There are two types of Trac users: registered users with a login and a password, and unregistered users who specified a name and an email address or a name only when creating or commenting the ticket.
Registered users are imported to YouTrack with their original name and email. Unregistered users are imported only if an email address is provided. All the users without email address are imported as guest. If you would like to import all the unregistered users as guest (without creating an account in YouTrack), set ACCEPT_NON_AUTHORISED_USERS to False in the mapping scheme:
- Visible to Group setting value is set to All Users for all the imported issues.
- Component is transferred to Subsystem.
- Owner is transferred to Default Assignee.
- Versions = Fix Version
- Type - configure the correspondence between the ticket Types in Trac and Issue Types in YouTrack in the mapping scheme. For example, the following mapping is used by default:
- Time = Submitted Time.
- Changetime = Last Updated Time.
- Severity - if this attribute is used in the Trac project, the corresponding custom fields will be created in YouTrack with the matching set of values.
- Priority - configure the correspondence between the Priority in Trac and Priority in YouTrack in the mapping scheme. The following mapping will be used by default:
- Reporter = Reporter
- Resolution and State are transferred to the single State field in YouTrack. Configure the correspondence between the Resolution and State values in Trac and State values in YouTrack in the mapping scheme. The correspondence between Resolution and State is checked first. By default, the following mapping is used:
- Keywords are transferred to Tags.
- Comments - comment text is imported along with the commenter's name.
- Attachments = Attachments.
- Custom fields - the description is taken from the trac.ini file along with the list of values, type and the default value. Appropriate custom fields are created in YouTrack while importing. The correspondence between the Trac custom fields type and YouTrack custom fields type is configured in the mapping scheme. The following mapping is used by default:
- You can specify mapping between Youtrack issue fields and Trac issue fields. In order to define mapping, use FIELD_NAMES dictionary. In default provided defaultTrac.py mapping file, the following dictionary is defined:
- Also, you can change target field types (field types in YouTrack) using FIELD_TYPES dictionary. In the default mapping file, the following dictionary is defined:
|Note: the default custom fields type mapping is used in the import rules in trac2youtrack.py. Do not forget to update the import rules in your script when changing the mapping.|