Skip to content

Instantly share code, notes, and snippets.

@juanmf
Last active November 8, 2015 13:42
Show Gist options
  • Save juanmf/8f75706af3ec7ed74918 to your computer and use it in GitHub Desktop.
Save juanmf/8f75706af3ec7ed74918 to your computer and use it in GitHub Desktop.
RedmineIssueImporter Config file for http://www.redmine.org/boards/1/topics/37725?r=42834#message-42834 example
#The Config File
# The tool: https://github.com/juanmf/RedmineIssueImporter
#Use the following config file format to import sheets into redmine. So far it creates Issues,
#with custom fields, but it's extensible to add users, etc..
################################################################################
# Run customization
################################################################################
redmine_account:
# http://www.redmine.org/projects/redmine/wiki/Rest_api#Authentication # show API Key.
# @Petr Czech, you should put your redmine API key here.
api_key: 'fc..8' #
host: 'http://redmine.myserver.com.ar/'
input_format:
file_type: 'Csv' # maps to CsvSheetRecordParser
delimiter: '#' # field delimiter COULD BE ; or | or anything that doesn not appear in the data.
# false Makes everithing but call save on entities, for tests before hitting API
save_records: true
################################################################################
# Sheets mapping configuration
################################################################################
on_error:
behavior: continue # [continue, stop, rollback]
display_exceptions: false # [true | false]
# redmine custom fields settings <objectType> => <customFieldName> => id => <idValue>
custom_fields:
issue: # you dont have custom fields in the example sheet.
# all sheets that can be imported should be mapped here
sheets:
#1st sheet definition
tasks:
name: Petr Czech, Imported tasks
# each sheet could host several record types, here's each definition
records:
task:
name: Task
# Redmine Objects/Entities that are related to sheet's data.
entities:
# Issue object
Issue:
defaults:
project: Petr Czech's Project Name
status: New
priority: Normal
assigned_to_id: 1 # @Petr Czech's User Id
author: 'Petr Czech'
due_date: ~
start_date: [Defaults\Defaults, startDate] # this calls a function and put current date and time, if value is empty.
tracker: TASK
subject: 'No Subject'
# These are the fields expected to be present in the CSV
fields:
# field name
tracker:
model: {entity: 'Issue', column: 'tracker'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 1, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: ~ # a callback method
subject:
model: {entity: 'Issue', column: 'subject'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 2, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: [Transformers\Transformer, asunto] # a callback method
description:
model: {entity: 'Issue', column: 'description'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 3, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: ~ # a callback method
status:
model: { entity: 'Issue', column: 'status'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 4, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: [Transformers\Transformer, estado] # a callback method
priority:
model: { entity: 'Issue', column: 'priority'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 5, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: ~ # a callback method
start_date:
model: { entity: 'Issue', column: 'start_date'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 6, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: [Transformers\Transformer, fecha] # a callback method
due_date:
model: { entity: 'Issue', column: 'due_date'} # entity referencia entities[entity] no al schema. Para eso está entities[entity][schema_entity], en caso de que difiera.
coord: {x: 7, y: 1}
default: ~ # Si !== ~ pisa al default del schema y al default en [entities]
increment: {x: 0, y: 1} # ~ = {x: 0, y: 0} if field is recurrent increment determines the relative loction of the next sibling. ~ means the field is no recurrent, only appears once in a sheet-
transform: [Transformers\Transformer, fecha] # a callback method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment