Answer the question
In order to leave comments, you need to log in
Notification about overdue tasks in Redmine
Tell me the plugin, or advise how to set it up.
Google for a week, nothing
Thank you!
Environment:
Redmine version 2.1.2.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.8
Environment production
Database adapter MySQL
Redmine plugins:
redmine_jquery_file_upload 0.0.1
redmine_lightbox 0.0.1
Answer the question
In order to leave comments, you need to log in
RAILS_ENV="production" rake redmine:send_reminders days=7 users="1,2,44"
the script notifies the director, performer and observers that today is the deadline for the task.
in the first select it is necessary to replace ("1","2","4") with those id, at which the task is considered incomplete. You can see the correspondence between the id and the name of the status in the issue_statuses database table.
and do not forget to change the variables with the access parameters to the database and mail account.
#!/bin/bash
mysql_h="db.local"
mysql_l="redmine"
mysql_p="password"
mysql_db="redmine"
mail_h="mail.local"
mail_l="mail_login"
mail_p="mail_pass"
/usr/local/bin/mysql -h$mysql_h -u$mysql_l -p$mysql_p -D$mysql_db -e \
"select id,assigned_to_id,author_id from issues where due_date='$date' and status_id in ("1" ,"2","4")" \
| grep -v id | while read l
do
issue_id=${l% * *}
mkdir data/$issue_id
echo ' redmine.local/issues/'$issue_id' ' > data/$issue_id/body.html
assigned_to_id=${l% *}
assigned_to_id= ${assigned_to_id#* }
echo $assigned_to_id >> data/$issue_id/id_list.txt
author_id=${l#* * }
echo $author_id >> data/$issue_id/id_list.txt
/usr/local/bin/mysql - h$mysql_h -u$mysql_l -p$mysql_p -D$mysql_db -e \
"select user_id from watchers where watchable_id='$issue_id'" \
| grep -v userid | while read m
do
echo $m >> data/$issue_id/id_list.txt
done
cat data/$issue_id/id_list.txt | sort | uniq | while read n
do
let i++
if [ $i -eq 1 ]
then x=\"$n\"
else x=$x,\"$n\"
fi
echo $x > data/$issue_id/id_tmp.txt
done
/ usr/local/bin/mysql -h$mysql_h -u$mysql_l -p$mysql_p -D$mysql_db -e \
"select mail from users where id in (`cat data/$issue_id/id_tmp.txt`)" \
| while read mail
do
if [ "$mail" != "mail"
/usr/local/bin/smtp-cli \
--missing-modules-ok --server=$mail_h --port=465 --ipv4 --ssl \
--user=$mail_l --pass=$mail_p -- from="Redmine <$mail_l>" \
--to "$mail" --subject="Redmine DEADLINE Issue $issue_id" \
--body-html=data/$issue_id/body.html
fi
done
done
Eh, that's what I did, it's just that the task is to send notifications exclusively about overdue tasks. To make it clear that these are overdue, i.e. sort them out. Preferably a plugin and preferably free. There will be no such option - I will leave this one, thanks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question