Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.
This repository was archived by the owner on Jan 12, 2021. It is now read-only.

Need help- example on using 'inc.update'  #40

Description

@dfields186

Help Please!! So I'm trying to update an incident ticket in a servicenow instance and need help from someone to show me how to do this with an actual example (for example: updating the short description on an incident ticket)

====================

help(inc.update)
Help on method update in module servicenow.ServiceNow:
update(where, data, **kwargs) method of servicenow.ServiceNow.Incident instance

update(self, where, data, **kwargs)

I'm thinking it should look something like this (I already have the 'conn' and 'inc' set):
conn = Connection.Auth(username=myusername, password=mypassword, instance=myinstance)
inc = ServiceNow.Incident(conn)

change_result = inc.update({'number': 'INC1234567',
'short_description': 'This is the new short description'})

Using the above syntax, I get the following error message:

TypeError: update() missing 1 required positional argument: 'data'

It looks like from the syntax, I need to specify a total of 3 arguments and I've only specified 2, but I'm not sure exactly what's missing.

where is: 'number': 'INC1234567'
data is: 'short_description': 'This is the new short description'
**kwargs: ??? not sure what to put here

I'm sure I have this completely wrong - I don't really want to keep experimenting since I'm using a production instance.

Thanks in advance!
David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions