Responding through Redmine

May 15, 2024

ID 269805

Redmine is a web application for project management and issue tracking. It allows you to automate the scenario of working with issues in Redmine projects by using the script if you previously configured integration between Kaspersky Next XDR Expert and the script launch service.

Download the script by clicking this link:

Download script

To use the script:

  1. Install the script in one of the following ways:
    • Via pip, for example:

      pip install -r requirements.txt

    • From the WHL file, for example:

      pip install ./dist/kaspersky_xdr_redmine_integration-1.0-py3-none-any.whl

    • Offline installation.

      If you do not have internet access, you have to install the script offline. In this case, do the following:

      1. Download the dependencies on a computer that has internet access, by using the following command:

        pip download -r requirements.txt

      2. Move the downloaded dependencies to the device on which you will run the script.
      3. Install the dependencies by using the following command:

        pip install --no-index --find-links <folder_path_to_downloaded_dependencies> -r requirements.txt

  2. Configure the script in one of the following ways:
    • Via the ENV file, for example:

      cp .env.sample .env

      nano .env

    • In the body of the script (redmine.py), edit the parameters in the following strings:

      REDMINE_URL: str = getenv("REDMINE_URL", "http://<ip_or_hostname>")

      REDMINE_PORT: str = getenv("REDMINE_PORT", "8080")

      REDMINE_API_KEY: str = str(getenv("REDMINE_API_KEY", "<redmine_api_key>"))

You can use the script to work with issues in Redmine.

  • If you want to create a new issue, run the following command:

    python redmine.py create_issue "project-identifier" "Issue subject" --description "Issue description text" --priority_id <id: int>

    Result:

    {"issue_id": 57}

  • If you want to update an issue, run the following command:

    python redmine.py update_issue <issue_id: int> --subject "Subject text to be updated" --description "Description text to be updated" --priority_id <id: int>

    Result:

    {"status": "issue_updated"}

  • If you want to get an issue, run the following command:

    python redmine.py get_issue <issue id: int>

    Result:

    {

    "subject": "86",

    "description": "18",

    "project_name": "Test project",

    "author_name": "Redmine Admin",

    "status_name": "backlog",

    "priority_name": "high",

    "start_date": "24.07.2023",

    "due_date": null,

    "created_on": "24.07.2023 10:56:15",

    "updated_on": "24.07.2023 17:18:38"

    }

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.