Skip to main content

A command-line interface for Zendesk Ticket Redaction app

Project description

# zendesk-redactor

zendesk-redactor is a command-line interface for the Zendesk [Ticket Redaction](https://www.zendesk.com/apps/support/ticket-redaction/) app.

## Motivation

The usability of the Ticket Redaction app is not so good. The redaction form does not support submitting multi-line input, so if you have multiple text snippets that you need to redact, you’d have to input them into the field and click the Redact button for each of them separately, one-by-one. This is very inefficient and time-consuming.

This tool tries to remedy this usability oversight by allowing you to redact multiple text snippets at once by either providing them as command-line arguments, or by writing them into a file and supplying the path to this file as a command-line option.

The tool also allows you to redact attachments, although it is currently not possible to do this selectively - it’s either all of them or none of them.

This tool is not a silver bullet though. If you have many text snippets that you need to redact, picking them out of the ticket is still a cumbersome manual process. But this tool will at least allow you to redact all of them at once, instead of clicking Redact for each of them separately.

## Installation

It’s Python, so make sure you have Python 3 installed, and run:

` $ pip install zendesk-redactor `

Although not strictly necessary, you might want to either create a virtualenv or use something like [pipx](https://github.com/pipxproject/pipx).

## Usage

### Authentication

In order to authenticate to Zendesk API you must provide the organization name, which usually is the subdomain part of your Zendesk URL before zendesk.com (e.g obscura for https://obscura.zendesk.com), your agent email address, and an API [token](https://developer.zendesk.com/rest_api/docs/support/introduction#using-a-zendesk-api-token).

These can be provided in two ways.

  1. As command-line options:

` $ zredactor --organization obscura --email agent@obscura.com --token BigSecret42 `

  1. As environment variables:

` export ZREDACTOR_ORGANIZATION=obscura export ZREDACTOR_EMAIL=agent@obscura.com export ZREDACTOR_TOKEN=BigSecret42 `

### Redacting text snipets

The following command will redact all occurrences of the text snippets foo, bar, baz in the ticket with ID 1742:

` $ zredactor --organization obscura --email agent@obscura.com --token BigSecret42 --ticket-id 1742 snippets foo bar baz `

Alternatively, if you use environment variables for authentication:

` $ zredactor --ticket-id 1742 snippets foo bar baz `

The following command will redact all occurrences of the text snippets provided in a file /tmp/to_redact.txt in the ticket with ID 1742:

` $ zredactor --organization obscura --email agent@obscura.com --token BigSecret42 --ticket-id 1742 snippets -f /tmp/to_redact.txt `

Alternatively, with authentication environment variables set:

` $ zredactor --ticket-id 1742 snippets -f /tmp/to_redact.txt `

The file must contain one snippet per line.

### Redacting attachments

The following command will redact all attachments in ticket with ID 1742:

` $ zredactor --organization obscura --email agent@obscura.com --token BigSecret42 --ticket-id 1742 attachments `

Alternatively, with authentication environment variables set:

` $ zredactor --ticket-id 1742 attachments `

Note that currently it is not possible to redact attachments selectively.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zendesk-redactor-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file zendesk-redactor-0.0.3.tar.gz.

File metadata

  • Download URL: zendesk-redactor-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/56.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5

File hashes

Hashes for zendesk-redactor-0.0.3.tar.gz
Algorithm Hash digest
SHA256 87247f6e151dc6a3bedde7962a341d08187264992a449de0a7f84c611a0659de
MD5 b176c0f5b2d1af858eac2a6a5689e5a3
BLAKE2b-256 0eda253d51de300d6a54c32b240e7615781f07d46e0bb561fb8bd6a878733c39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page