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

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

Open
dfields186 opened this issue May 29, 2019 · 0 comments
Open

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

dfields186 opened this issue May 29, 2019 · 0 comments

Comments

@dfields186
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant