Skip to main content

A python module to access ServiceNow REST API

Project description

Installation
------------
pip install servicenow_client


Usage examples::
--------------

import servicenow_client

# Create object
# if empty_error is True, exception will be raised if query result is empty
obj = servicenow_client.servNow(instance='myinstance', user='myuser', password='mypassword', empty_error=True)

# Create a new record
obj.create(table='incident', data={'short_description':'My Incident Ticket'})

# Update record(s) based on search condition
# searchList=['field', 'operator', 'value']
obj.update(table='incident', searchList=[['short_description','is','My Incident Ticket'], ['number','is not','INC0010022']], data={'state': '1'})

# Search for record(s) and display only 'number' and 'sys_id' from the results
# if fields is not defined it will return all fiels in response
obj.search(table='incident', searchList=['short_description','is not empty'], fields='number,sys_id')

# Delete record(s) based on search condition
obj.delete(table='problem', searchList=['short_description','is','Problem Ticket'])

# Change state of record(s) based on search condition
obj.changeState(table='incident', searchList=['short_description','is','ISAN Problem 2'], state='In progress')

# Download a specific attachement or particular type of attachement related to record(s) based on search condition
obj.getFile(table='incident', searchList=['short_description','is','test123'], type='.jpg')

# Upload an attachement to record(s) that satisfy the search condition
obj.uploadFile(table='incident', searchList=['short_description', 'is', 'test'], filename='D:\Tulips.jpg')

# Delete an attachement from record(s) that satisfy the search condition
obj.deleteFile(table='incident', searchList=['short_description', 'is', 'Upload 4'], filename='Riddles Treasure Hunt.pdf')

# Send email related to a particular record
# To send email not related to any specific record skip 'table' and 'sysId' fields
obj.sendEmail(table='incident', subject='Hello', message='hi', to='abc@example.com, xyz@example.com', sysId='33434f713200e1e0b5e18110c75b')

# Read email, where sysId is sysId of email
obj.readEmail(sysId='33434f713200e1e0b5e18110c75b')


Compatibility
-------------
Python 2 Tested: Python 2.6+
ServiceNow Tested: Istanbul, Geneva


Author
------
Created by Parul Neeraj <parulneeraj007@gmail.com> in 2017

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

servicenow_client-0.1.0.zip (8.0 kB view details)

Uploaded Source

File details

Details for the file servicenow_client-0.1.0.zip.

File metadata

File hashes

Hashes for servicenow_client-0.1.0.zip
Algorithm Hash digest
SHA256 bbc5aedc4810537e35198c0ae24c908abd8ba9f6798c4e3b8645f9499b786db7
MD5 d6676d0689588d763769d85d0d078e0e
BLAKE2b-256 e7ed9af8af3820c69fcad019d641c6f128ce8347669cbc37bbbcfc376205fa8d

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