kraiz / hamster-bridge

let your hamster log your work to your favorite bugtracker
Other
14 stars 8 forks source link

Unable to send description to redmine #30

Closed chama-chomo closed 6 years ago

chama-chomo commented 6 years ago

Hi, while trying to integrate hamster with our internal redmine server (3.3.5) I'm not able to update the time in redmine with description of the ticket being updated. The thing is, I can't see anything wrong with the request, besides I've been trying many scenarios, none of them got accepted, except the one only with ticket ID alone. Below I'm pasting working case and a failed one

failed

2018-06-19 21:52:48,448   DEBUG [hamster_bridge.bridge]: Found a stopped task: {'category': u'test', 'activity_id': dbus.Int32(62), 'description': u'test', 'tags': [], 'start_time': datetime.datetime(2018, 6, 19, 21, 51, 22), 'ponies': False, 'original_activity': dbus.String(u'22947'), 'delta': datetime.timedelta(0, 85), 'end_time': datetime.datetime(2018, 6, 19, 21, 52, 47), 'activity': u'22947', 'date': datetime.date(2018, 6, 19), 'id': dbus.Int32(117)}
2018-06-19 21:52:48,448   ERROR [hamster_bridge.listeners.redmine]: Unable to query issue for stopping of hamster fact 22947  

working one, it is accepted by redmine, though no description gets processed further

2018-06-19 09:22:00,172   DEBUG [hamster_bridge.bridge]: Found a started task: {'category': u'Unsorted', 'activity_id': dbus.Int32(54), 'description': None, 'tags': [], 'start_time': datetime.datetime(2018, 6, 19, 9, 21, 59), 'ponies': False, 'original_activity': dbus.String(u'22948 test'), 'delta': datetime.timedelta(0, 1), 'end_time': None, 'activity': u'22948 test', 'date': datetime.date(2018, 6, 19), 'id': dbus.Int32(97)}
2018-06-19 09:23:20,390   DEBUG [hamster_bridge.bridge]: Found a stopped task: {'category': u'Unsorted', 'activity_id': dbus.Int32(54), 'description': None, 'tags': [], 'start_time': datetime.datetime(2018, 6, 19, 9, 21, 59), 'ponies': False, 'original_activity': dbus.String(u'22948 test'), 'delta': datetime.timedelta(0, 79), 'end_time': datetime.datetime(2018, 6, 19, 9, 23, 18), 'activity': u'22948 test', 'date': datetime.date(2018, 6, 19), 'id': dbus.Int32(97)}
2018-06-19 09:23:20,393   DEBUG [urllib3.connectionpool]: Resetting dropped connection: 

Can you please advice what should be a proper string in hamster to get both, ticket and its description , accepted? Thanks

chama-chomo commented 6 years ago

I've changed a regexp in redmine.py

 -     issue_from_title = re.compile('([0-9]+\ )')
 +     issue_from_title = re.compile('([0-9]+)')

and now it's working for me.