A bot for Redmine that sends reminders and/or closes orphaned tickets.
Find a file
Marc Michalsky 03c1a95cb7
🐛 avoid TypeError
TypeError: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'
2024-07-15 14:40:36 +02:00
templates 📚 update README.md 2021-11-12 09:41:54 +01:00
.example_env 🎉 initial commit 2021-06-22 19:59:09 +02:00
.gitignore 🙈 add .venv to .gitignore 2024-07-10 15:33:29 +02:00
example_config.yaml find issue status ids by their names 2021-11-05 11:56:33 +01:00
exceptions.py find 'issue_closed_status_id' by its name 2021-11-04 17:14:14 +01:00
LICENSE Create LICENSE 2021-06-22 20:00:45 +02:00
main.py 🐛 avoid TypeError 2024-07-15 14:40:36 +02:00
README.md 📚 update README.md 2021-11-12 09:41:54 +01:00
requirements.txt ⬆️ upgrade dependencies 2024-07-10 15:33:29 +02:00

Marvin

Marvin is a bot for Redmine. He helps you to tidy up your ticket system by nudging and/or closing abandoned tickets.

Configuration

After pulling the repository you have to create a virtual environment within the repository folder:

python3 -m venv ./venv

Activate the virtual environment:

source venv/bin/activate

Then you have to fulfill the dependencies with:

pip3 install -r requirements.txt

Next copy the example files, rename them to .env and config.yaml and fill in the right values.

Configure actions

You can define different actions for the bot to perform.
Below the actions section in the config.yaml you can add your own actions.

actions:

  waiting_for_feedback:
    start_date: "2021-01-01"  # Date from which tickets are to be processed (all tickets from yyyy-mm-dd)
    time_range: "14"  # Number of days that should be exceeded without updates on the ticket
    projects:
      - "IT Tickets"  # List of redmine projects
    status:
      - "Waiting for feedback"  # List of all issue status you want to treat
    close_ticket: true  # optional: should the ticket get closed after the update?
    template: "close_ticket" # Template for the update massage

  in_revision:
    start_date: "2021-01-01"
    time_range: "14"
    projects:
      - "IT Tickets"
    status:
      - "In revision"
    template: "nudge_ticket"
    change_status_to: "Waiting for feedback"  # optional: change the ticket status to "waiting for feedback"

Usage

To run the script at regular intervals, simply add it to the crontab.

Open crontab

crontab -e

Add entry

30 8 * * 1-5 /path/to/Marvin/venv/bin/python /path/to/Marvin/main.py

This executes the script every weekday at 8.30 am.