django-snow
django-snow is a django app to manage ServiceNow tickets from within a django project.
Installation
pip install django-snow
Configuration
django-snow requires the following settings to be set in your Django settings:
SNOW_INSTANCE - The ServiceNow instance where the tickets should be created
SNOW_API_USER - The ServiceNow API User
SNOW_API_PASS - The ServiceNow API User’s Password
SNOW_ASSIGNMENT_GROUP (Optional) - The group to which the tickets should be assigned. If this is not provided, each call to create the tickets should be provided with an assignment_group argument. See the API documentation for more details
SNOW_DEFAULT_CHANGE_TYPE (Optional) - Default Change Request Type. If not provided, standard will considered as the default type.
Usage
Creation
ChangeRequestHandler.create_change_request has the following parameters and return value:
Parameters
title - The title of the change request
description - The description of the change request
assignment_group - The group to which the change request is to be assigned. This is optional if SNOW_ASSIGNMENT_GROUP django settings is available, else, it is mandatory
payload (Optional) - The payload for creating the Change Request.
Returns
ChangeRequest model - The model created from the created Change Order.
Example
from django_snow.helpers import ChangeRequestHandler
def change_data(self):
co_handler = ChangeRequestHandler()
change_request = co_handler.create_change_request('Title', 'Description', 'assignment_group')
Updating
ChangeRequestHandler.update_change_request method signature:
Parameters
change_request - The ChangeRequest Model
payload - The payload to pass to the ServiceNow REST API.
Example
from django_snow.models import ChangeRequest
from django_snow.helpers import ChangeRequestHandler
def change_data(self):
change_request = ChangeRequest.objects.filter(...)
co_handler = ChangeRequestHandler()
payload = {
'description': 'updated description',
'state': ChangeRequest.TICKET_STATE_IN_PROGRESS
}
co_handler.update_change_request(change_request, payload)
Closing
ChangeRequestHandler.close_change_request has the following signature:
Parameters
change_request - The ChangeRequest Model representing the Change Order to be closed.
Example
from django_snow.models import ChangeRequest
from django_snow.helpers import ChangeRequestHandler
def change_data(self):
change_request = ChangeRequest.objects.filter(...)
co_handler = ChangeRequestHandler()
co_handler.close_change_request(change_request)
Closing with error
ChangeRequestHandler.close_change_request_with_error method signature:
Parameters
change_request - The ChangeRequest Model representing the Change Order to be closed with error
payload - The payload to pass to the ServiceNow REST API.
Example
from django_snow.models import ChangeRequest
from django_snow.helpers import ChangeRequestHandler
def change_data(self):
change_request = ChangeRequest.objects.filter(...)
co_handler = ChangeRequestHandler()
payload = {
'description': 'updated description',
'title': 'foo'
}
co_handler.close_change_request_with_error(change_request, payload)
Models
ChangeRequest
The ChangeRequest model has the following attributes:
sys_id - The sys_id of the Change Request.
number - Change Request Number.
title - The title of the Change Request a.k.a short_description.
description - Description for the change request
assignment_group_guid - The GUID of the group to which the Change Request is assigned to
state - The State of the Change Request. Can be any one of the following ChangeRequest’s constants:
TICKET_STATE_OPEN - ‘1’
TICKET_STATE_IN_PROGRESS - ‘2’
TICKET_STATE_COMPLETE - ‘3’
TICKET_STATE_COMPLETE_WITH_ERRORS - ‘4’
Supported Ticket Types
Change Requests
Metadata
Release files for django-snow 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-snow-1.2.0.tar.gz | 9.4 kB | Without provenance | Details for django-snow-1.2.0.tar.gz |
Release files / django-snow-1.2.0.tar.gz
| Download URL | django-snow-1.2.0.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13f2dc78469e013b08a12ccba863990e673f7d25d839e88a628df63c3d673138
|
|
BLAKE2b-256 checksum How to use checksums |
a895920ad8d7903bcdaa5e6bf11bec6f3d1b6ec1b7989dde36a358d8fee4901b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-snow 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.