thomasklein / redmine2mite

Redmine2mite connects your Redmine account with your mite.account. Track your time easily on issues within Redmine and get them automatically send to mite.
http://mite.yo.lk/
MIT License
13 stars 6 forks source link

Connect time entries created via note to the note-id of the issue #6

Open das-peter opened 13 years ago

das-peter commented 13 years ago

Hi Thomas,

The new feature of v1.3 is great - it greatly improves the workflow by removing extra steps. There's only one thing I miss at the moment: I have still to create an extra comment to know what exactly the tracked time was used for - even that's often exactly what the note itself already describes. Thus it would be nice if the time entry is not only related to the issue number but also to the note id if applicable.

I'm not sure how to solve this - I thought about these two possibilities:

Besides the fact that I don't know ruby nor the redmine internals I would tend to solution two since it looks more flexible and future-proof. ;)

Best regards, Peter

thomasklein commented 13 years ago

Hey Peter! At the very bottom of the plugin settings page in Redmine (this is the screen where you input your mite credentials) you will find the input field "Additional infos for a time entry note". Here you input a set of dynamic placeholders, also the issue number (which is {issue_id}) which will be set in front of every time entry comment. Is is that what you are looking for or did you mean something else?

Thomas

das-peter commented 13 years ago

Thanks for your Feedback. Frankly speaking I wasn't aware of this configuration - I think that would be the right thing. I gave it a try, but unfortunately it doesn't support notes. Btw. with "notes" I mean the posts in a task/issue (Marked with a red border here: http://img16.imageshack.us/img16/5073/notetf.png).

I would like to be able, to set the note-id / note-nr (eg. Note #3 ) into the comment of the time entry by using a placeholder like {note-id}. Passing the whole note text into the entry doesn't seem a good idea because that could be quite a lot of text incl. formatting.

Thanks Peter

thomasklein commented 13 years ago

Okay, now I got your point - good idea! This will be included in the next release, as I want to implement several feature requests into one update. So I hope not too urgent!

Thomas

das-peter commented 13 years ago

Nice, thank you Thomas! And no need to hurry.

Cheers Peter

Buesing-Sebastian commented 12 years ago

Hi Thomas,

I'd like to give this a shot but would love some feedback on my approach first.

  1. Add the (optional) field journal_id to the time_entries table.
  2. Use the hook ":controller_issues_edit_after_save" to make this connection if possible.

from here we could do one of the following:

either

3a. Inside the method implementing the hook I would call a hook ":controller_journal_time_entry_connected" which would have to be implemented by your plugin to update the time_entry since it now knows the "{note_id}".

or

3b. Simple update the mite time entry inside the method. Less generic but works too.

  1. Add a hook near (or inside) [TimeEntryPatch] comment = replace_placeholders(self[:comments],User.current.preference[:mite_note_pattern])

to allow for easy manipulation by other plugins.

What do you think about this approach? That is if you understood me :-)

Sebastian