Import from Trac
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, thedefaultTrac.py
mapping scheme will be used.#import tracLib.defaultTrac import tracLib.myMapping
- From the Python Client Library installation directory, execute the following command:
Enter values for the following command-line parameters:
python trac2youtrack.py target_url target_login target_password project_ID project_name path_to_trac_environment
Notes on Mapping
- 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 toFalse
in the mapping scheme:ACCEPT_NON_AUTHORISED_USERS=False
- 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:
"defect" : "Bug", "enhancement" : "Feature", "task" : "Task"
- 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:
"trivial" : "Minor", "minor" : "Normal", "major" : "Major", "critical" : "Critical", "blocker" : "Show-stopper"
- 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:
tracLib.RESOLUTIONS = { "duplicate" : "Duplicate", "fixed" : "Fixed", "wontfix" : "Won't fix", "worksforme" : "Can't Reproduce", "invalid" : "Can't Reproduce" } tracLib.STATES = { "accepted" : "Submitted", "new" : "Open", "reopened" : "Reopened", "assigned" : "Submitted" }
- Summary=Summary.
- Description=Description.
- 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:
"text" : "string", "checkbox" : "enum[*]", "select" : "enum[1]", "radio" : "enum[1]", "textarea" : "string"
- You can specify mapping between YouTrack issue fields and Trac issue fields. In order to define mapping, use
FIELD_NAMES
dictionary. In default provideddefaultTrac.py
mapping file, the following dictionary is defined:tracLib.FIELD_NAMES = { "Resolution" : "State", "Status" : "State", "Owner" : "Assignee", "Version" : "Fix versions", "Component" : "Subsystem" }
- 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:tracLib.FIELD_TYPES = { "Priority" : "enum[1]", "Type" : "enum[1]", "State" : "state[1]", "Fix versions" : "version[*]", "Affected versions" : "version[*]", "Assignee" : "user[1]", "Severity" : "enum[1]", "Subsystem" : "ownedField[1]" }
Last modified: 18 April 2017