diff --git a/git_redmine.py b/git_redmine.py index 5be2e57..c43b141 100644 --- a/git_redmine.py +++ b/git_redmine.py @@ -58,6 +58,7 @@ def get_redmine_api(): redmine = Redmine(url, **kwargs) redmine.engine.session.mount('http://', HTTPAdapter(max_retries=3)) redmine.engine.session.mount('https://', HTTPAdapter(max_retries=3)) + redmine.developpement = [tr for tr in redmine.tracker.all() if tr.name == u'Développement'][0] redmine.rustine = [cf for cf in redmine.custom_field.all() if cf.name == u'Rustine proposée'][0] redmine.solution = [st for st in redmine.issue_status.all() if st.name == u'Solution proposée'][0] redmine.resolu_a_deployer = [st for st in redmine.issue_status.all() if st.name == u'Résolu (à déployer)'][0] @@ -282,6 +283,7 @@ def submit(ctx, issue, number_of_commits): 'to assign the issue to yourself ?' % issue.assigned_to.name): issue.assigned_to_id = current_user.id issue.save() + kwargs['tracker_id'] = api.developpement.id kwargs['status_id'] = api.solution.id api.issue.update(issue.id, notes=message, uploads=patches, custom_fields=[{'id': api.rustine.id, 'value': u'1'}], @@ -318,6 +320,7 @@ def new(ctx): issue = api.issue.create( project_id=project.id, subject=subject, + tracker_id=api.developpement.id, description=description, assigned_to_id=current_user.id) click.echo('Created issue %s' % issue.url)