Metadata-Version: 2.1
Name: argus_ticket_rt
Version: 1.0.1
Summary: Allow argus-server to create tickets in Request Tracker
Author-email: Johanna England <johanna.england@sikt.no>
Maintainer-email: Johanna England <johanna.england@sikt.no>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: System :: Monitoring
Requires-Dist: argus-server>=1.11
Requires-Dist: rt>=3.0
Requires-Dist: tox ; extra == "test"
Requires-Dist: coverage ; extra == "test"
Project-URL: Home, https://github.com/Uninett/argus_ticket_rt
Project-URL: Issues, https://github.com/Uninett/argus_ticket_rt/issues
Provides-Extra: test

# argus_ticket_rt

This is a plugin to create tickets in Request Tracker from [Argus](https://github.com/Uninett/argus-server)

The API supported is RT V2. RT 4.4 needs [RT::Extension::REST2](https://github.com/bestpractical/rt-extension-rest2)
to support V2, while RT 5.0.0 and later has the support included.

## Settings

* `TICKET_ENDPOINT`: Link to instance, absolute URL
* `TICKET_AUTHENTICATION_SECRET`: Standard username/password or token:

    ```
    {
        "username": username,
        "password": password
    }
    ```

    or

    ```
    {
        "token": token
    }
    ```

* `TICKET_INFORMATION`:

    Queue (obligatory)

    ```
    {
        "queue": queue_name
    }
    ```

    ### Custom fields (optional)

    There are two ways of automatically filling custom fields:

    1. Custom fields that are always the same, independent of the incident.
    These will be set in `custom_fields_set` with the name of the custom field as key and the fixed value as value.


        ```
        {
            "custom_fields_set" : {
                "name_of_custom_field": set_value,
            }
        }
        ```

    2. Custom fields that are filled by attributes of the Argus incident. These are set in `custom_fields_mapping` with the name of the custom field as key and the name of the attribute as it is returned by the API  as value (e.g. `start_time`). If the information can be found in the tags the value consists of a dictionary with `tag` as the key and the name of the tag as the value (e.g. {"tag": "host"}).

        ```
        {
            "custom_fields_mapping" : {
                "name_of_custom_field": attribute_of_incident,
                "name_of_custom_field": {"tag": name_of_tag},
            }
        }
        ```

## Library

The library used is [rt](https://pypi.org/project/rt/)
instead of [rt-client](https://pypi.org/project/rt-client/)
because "rt-client" does not support token authentication.

## Code style

argus_ticket_rt uses black as a source code formatter. Black can be installed
by running

```console
$ pip install black
```

A pre-commit hook will format new code automatically before committing.
To enable this pre-commit hook, run

```console
$ pre-commit install
```

