finding tickets assigned to former employees
Added by Han Boetes almost 4 years ago
I got a question if I could find all tickets assigned to former employees and I wrote this not very pretty but working script:
#!/bin/sh disabled_users=$(echo 'select id from users where status = 3;' | mysql -N redmine) for du in $disabled_users; do echo "select project_id, id, assigned_to_id from issues where assigned_to_id = $du and status_id = 2;" | mysql -N redmine; done | \ while read project id user; do PN=$(echo "select name from projects where id = $project" | mysql -N redmine) user=$(echo "select login from users where id = $user" | mysql -N redmine) echo "Ticket $id in project '$PN' is assigned to '$user'" done
I'm aware this could be done with one mysql statement, but my mysql skills are rather bad and this works as well. Improvements are welcome of course.
I've read this feature has been implemented in redmine 4, so this is for all redmine 3 users.