-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Servicenow python #2109
Servicenow python #2109
Conversation
I ran the test playbook and it passed, though it's not in the build because the instance keeps hibernating. doc: https://github.com/demisto/etc/issues/12838 |
@@ -0,0 +1,1728 @@ | |||
commonfields: | |||
id: ServiceNow_python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should override the old one (same id + name)
|
||
def load_proxy(): | ||
proxy = {} | ||
if "proxy" in demisto.params(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should verify that the value is true.
possible bug:
- create instance -> no proxy in params
- set proxy -> proxy=true in params
- disable proxy -> proxy=false in params (but it will exist)
PASSWORD = demisto.params()['credentials']['password'] | ||
VERIFY_SSL = not demisto.params().get('insecure', False) | ||
API = '/api/now/' | ||
VERSION = demisto.params().get('api_version', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to specify default value in case of None
file_id = demisto.args()['file_id'] | ||
file_name = demisto.args().get('file_name', | ||
demisto.dt(demisto.context(), "File(val.EntryID=='"+file_id+"').Name")) | ||
file_name = file_name[0] if isinstance(file_name, list) else file_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when will it be a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's more than one file in the context
return 'Computer not found' | ||
|
||
hr = { | ||
'Id': computer['sys_id'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backward compatibility, can add ID in addition
for group in res['result']: | ||
if group['name'] == group_name: | ||
hr_groups.append({ | ||
'Id': group['sys_id'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backward compatibility, can add ID in addition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the Human-readable, not context
query_params = {} | ||
incidents = [] | ||
sysparm_query = demisto.params().get('sysparm_query', None) | ||
sysparm_limit = demisto.params().get('fetch_limit', DEFAULTS['limit']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be DEFAULTS['fetch_limit']
res = send_request(path, 'get', params = query_params) | ||
|
||
for result in res['result']: | ||
incident = result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
* add the integration * fetch incidents * fixes * file upload * get computer, groups * change human readable, incident -> ticket * output types * fix version * add file context * descriptions * return SNOW error * CR fixes #1 * delete unnecessary file * fix dictionary/string
No description provided.