W
W
WordPress WooCommerce2017-05-05 17:34:31
Redmine
WordPress WooCommerce, 2017-05-05 17:34:31

How to programmatically add a comment (note, note) to a Redmine task?

Hello valiant redmine heroes!
I have a notification letter sent to a special address when a task is added in the Redmine project. Works through the appropriate hook.
After sending the mail, I need to add a comment to the task that the mail was sent successfully.
I can't find a method that allows you to programmatically add a comment to a task.
In the context of a hook, I have task data.
Somehow I get the Issue object
@issue = context[:issue]
But what to do next - I just can’t google / figure it out.
Kick good people, me stupid, in the right direction :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WordPress WooCommerce, 2017-05-10
@maxxannik

It turned out like this:

@issue = context[:issue]
@author = User.find(@issue.author_id)
journal = @issue.init_journal(@author, 'Система сама выполнила такую то работу по данной задаче')
journal.save

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question