GithubHelp home page GithubHelp logo

ministryofjustice / django-zendesk-tickets Goto Github PK

View Code? Open in Web Editor NEW
6.0 8.0 2.0 88 KB

Django views and forms that submit tickets to Zendesk

License: MIT License

Python 96.87% HTML 0.15% Makefile 2.98%

django-zendesk-tickets's Introduction

Django Zendesk Tickets

An extensible library to add Django views with forms to submit tickets to Zendesk.

Usage

Add these to your settings.py:

ZENDESK_BASE_URL = 'https://example.zendesk.com'
ZENDESK_API_USERNAME = ...
ZENDESK_API_TOKEN = ...
ZENDESK_REQUESTER_ID = ...
ZENDESK_GROUP_ID = ...

Add an entry to your urls.py

from zendesk_tickets.views import TicketView

path(r'submit-ticket/$', TicketView.as_view(
    success_url='/',
    template_name='app_name/submit-ticket-page.html',
    ticket_subject='Website Feedback',
    ticket_tags=['website', 'feedback']
    ticket_template_name='app_name/feedback-ticket.txt',
), name='submit_ticket'),

If you wish to include additional fields, subclass BaseTicketForm and add them. If you wish to include them in the body of the ticket, create a new ticket template and pass it as the ticket_template_name. If you wish to include them as custom fields, define the following in your settings.py:

ZENDESK_CUSTOM_FIELDS = {
    'referer': 31,  # zendesk field id
    'username': 32,
    'user_agent': 33,
}

The three fields in the example above are included in TicketForm by default and can be included in your ticket by referencing them in the ticket template or specifying custom field ids in settings.

Development

https://github.com/ministryofjustice/django-zendesk-tickets/actions/workflows/test.yml/badge.svg?branch=main https://github.com/ministryofjustice/django-zendesk-tickets/actions/workflows/lint.yml/badge.svg?branch=main

Please report bugs and open pull requests on GitHub.

Use python setup.py test to run all tests.

If any localisable strings change, run python setup.py makemessages compilemessages.

Distribute a new version to PyPI by updating the VERSION tuple in zendesk_tickets/__init__.py and publishing a release in GitHub (this triggers a GitHub Actions workflow to automatically upload it). Alternatively, run python setup.py compilemessages sdist bdist_wheel upload locally. Remember to update History.

History

0.16
Drop support for python 3.6 and 3.7. Add support for python 3.11. Add experimental support for Django versions 4.0 & 4.1. Improve testing and linting.
0.15
Add support for python 3.9 and 3.10. Improve testing and linting.
0.14
Drop support for python 3.5. Improve linting.
0.13
Drop python 2 support (now compatible with 3.5 - 3.8). Support Django 2.2 - 3.2 (both LTS).
0.12
Improve testing and linting.
0.11
Support Django 1.10 - 2.0. Add class-based Django views. Add internationalisation support.
0.10
Fix display of tickets in Zendesk.
0.9
Don’t allow self-referential return-to URL.
0.8
Accept extra template context in views.
0.7
Use email address of logged-in user when available.
0.6
Collect email address of form submitter, optionally.
0.5
Fix bugs.
0.4
Provide a safe "return back to where you came from" link.
0.3
Add success view.
0.2
Fix bugs.
0.1
Original release.

Copyright

Copyright (C) 2023 HM Government (Ministry of Justice Digital & Technology). See LICENSE.txt for further details.

django-zendesk-tickets's People

Contributors

ibrechin avatar ushkarev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-zendesk-tickets's Issues

A branch protection setting is not enabled: administrators require review

Hi there
The default branch protection setting called administrators require review is not enabled for this repository
See repository settings/Branches/Branch protection rules
Either add a new Branch protection rule or edit the existing branch protection rule and select the Require a pull request before merging option
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

A branch protection setting is not enabled: Include administrators

Hi there
The default branch protection setting called Include administrators is not enabled for this repository
See repository settings/Branches/Branch protection rules
Either add a new Branch protection rule or edit the existing branch protection rule and select the Include administrators option
This will enable the branch protection rules to admin uses as well
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

Default branch is not main

Hi there
The default branch for this repository is not set to main
See repository settings/settings/branches to rename the default branch to main and ensure the Branch protection rules is set to main as well
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.