Metadata-Version: 2.4
Name: wagtail-ticketmaker
Version: 1.0.1
Summary: Configurable support-ticket reporting for Wagtail editors.
License-Expression: BSD-3-Clause
Classifier: Framework :: Django
Classifier: Framework :: Wagtail
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<5.3,>=5.2
Requires-Dist: wagtail>=7
Provides-Extra: browser
Requires-Dist: playwright>=1.50; extra == "browser"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-django>=4.8; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: twine>=6.1; extra == "dev"
Dynamic: license-file

# Wagtail Ticketmaker

Version: **v1.0.0**.

Submit support tickets to Jira Service Management from the Wagtail page editor
or frontend userbar. Supports Python 3.10+, Django 5.2 and Wagtail 7 or later, without an upper
Wagtail version limit. Newer Wagtail releases may require a newer Python version.
CI tests the minimum Wagtail series and the latest compatible release.
Tickets can include a cropped PNG screenshot. Tickets and screenshots are not
stored by this package.

## Installation

```bash
pip install wagtail-ticketmaker
```

Add `wagtail.contrib.settings` and `wagtail_ticketmaker` to `INSTALLED_APPS`, then run:

```bash
python manage.py migrate
```

## Configuration

Configure each Wagtail site's hostname in Django settings:

```python
import os

WAGTAIL_TICKETMAKER_SITES = {
    "www.example.com": {
        "jira_base_url": "https://support.example.com",
        "service_account_email": "support@example.com",
        "service_desk_id": "4",
        "organisation_customfield_id": "customfield_10002",
        "organisation_id": os.environ["JIRA_ORGANISATION_ID"],
        "reporter_account_id": os.environ["JIRA_REPORTER_ACCOUNT_ID"],
        "api_token": os.environ["JIRA_API_TOKEN"],
        "request_types": [
            {"label": "Support", "request_type_id": "17"},
            {"label": "Feature", "request_type_id": "18"},
        ],
    },
}
```

Replace example values with the corresponding Jira configuration. All fields
above are required. Keep credentials in environment variables. Requests use the
fixed reporter account and include the Wagtail user's details in the description.

Priority options are `blocker`, `minor`, `highest`, `high`, `medium`, `low`,
`lowest`, in that order, with `medium` selected by default. Jira request types
must expose Priority and support the corresponding names: Blocker, Minor,
Highest, High, Medium, Low and Lowest.

## Access and appearance

Assign `wagtail_ticketmaker.submit_support_ticket` in **Settings → Groups** to
allow ticket submissions. Users also need the usual Wagtail page permissions.
Assign `wagtail_ticketmaker.change_ticketmakersettings` to manage
**Settings → Ticketmaker settings**: texts, visibility and screenshot requirements.
The interface follows the Wagtail theme and supports English and Dutch.

For a shared user allowlist, set `WAGTAIL_TICKETMAKER_SHARED_ACCESS = True` and
designate an active Wagtail admin user as `TicketAccess.owner` through a Django
shell. The owner manages membership and site exceptions in **Settings → Ticket access**.

## Development

```bash
pip install -e ".[dev]"
ruff check .
ruff format --check .
pytest
node --test tests/test_screenshot.js
```

## License

BSD-3-Clause; see [LICENSE](LICENSE). The bundled modern-screenshot renderer is
MIT licensed, with its license included alongside the JavaScript bundle.
