| 27 | 1. Modify the configuration file, import-configuration.sample.xml. There are several sections: |
| 28 | 1. Common: common stuff. '''scarab-attachments-path''' should be the path where the attachment are Scarab |
| 29 | {{{ |
| 30 | #!xml |
| 31 | <common> |
| 32 | <trac-xmlrpc-url>http://any-host-to-trac/projects/a-project/login/xmlrpc</trac-xmlrpc-url> |
| 33 | <scarab-attachments-path>/tmp/scarab/attch_scarab</scarab-attachments-path> |
| 34 | </common> |
| 35 | }}} |
| 36 | 1. Mappings between scarab users and trac users |
| 37 | {{{ |
| 38 | #!xml |
| 39 | <users-map> |
| 40 | <user id-scarab="scarab-userA" id-trac="trac-userA" /> |
| 41 | <user id-scarab="scarab-userA" id-trac="trac-userB" /> |
| 42 | </users-map> |
| 43 | }}} |
| 44 | 1. Global mappings between scarab und trac form fields. The optional ''ignore'' attribute indicates that if the field does not exist in the Trac form, will be ignored. It is used to define fields to be used as part of other fields (in transformations). The '''transformation''' tag indicates that before setting the value of these field there will be a Genshi transformation, using as context all fields (including those marked with ignore = true) |
| 45 | {{{ |
| 46 | #!xml |
| 47 | <global-attributes-map> |
| 48 | <attribute id-scarab="Para" id-trac="owner" /> |
| 49 | <attribute id-scarab="CC" id-trac="cc" ignore="true"/> |
| 50 | <attribute id-scarab="Caso de Test" id-trac="summary"> |
| 51 | <transformation>$ticket.summary [Issue Scarab $ticket.id]</transformation> |
| 52 | </attribute> |
| 53 | </global-attributes-map> |
| 54 | }}} |
| 55 | 1. a '''scarab-artifact''' section: mappings for a particular scarab issue type. '''additional-attributes''' Adds to Trac ticket (ticket-type attribute) associated with scarab issue (type attribute). The value is too a Genshi transformation. Should have a '''scarab-artifact''' tag for each Scarab Issue type. |
| 56 | {{{ |
| 57 | #!xml |
| 58 | <scarab-artifact type="Reporte Error QA" ticket-type="Defecto"> |
| 59 | <attributes-map> |
| 60 | <!-- equal to globalattributes-map --> |
| 61 | </attributes-map> |
| 63 | <additional-attributes> |
| 64 | <attribute id="description"> |
| 65 | Ticket importado desde Scarab, ID = ${ticket.id} |
| 66 | {% if "descripcion_scarab" in ticket %}${ticket.descripcion_scarab}{% end %} |
| 67 | {% if "log" in ticket %}Log: |
| 68 | ${ticket.log} |
| 69 | {% end %} |
| 70 | {% if "observaciones_comentarios_mejoras" in ticket %}Observaciones, comentarios y mejoras: |
| 71 | $ticket.observaciones_comentarios_mejoras |
| 72 | {% end %} |
| 73 | </attribute> |
| 74 | </additional-attributes> |
| 75 | }}} |
| 76 | 1. a '''status-map''': maps the status field between Scarab and Trac statuses. |
| 77 | {{{ |
| 78 | #!xml |
| 79 | <status-map> |
| 80 | <status id-scarab="Abierto" id-trac="new" /> |
| 81 | <status id-scarab='Resuelto' id-trac='closed' /> |
| 82 | </status-map> |
| 83 | }}} |
| 84 | 1. The scarab2trac.py script should run in a text terminal. With the "-h" parameter it prints the help: |
| 85 | {{{ |
| 86 | Usage: scarab2trac.py [options] |