Skip to content
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

PAPP-33317: ServiceNow - updated pagination logic #18

Merged
merged 38 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3861b2a
Servicenow: PAPP-29359 Added new action - search sources
dhwanis-crest Apr 12, 2023
49bfd1b
Update README.md
Apr 12, 2023
483a304
Adding empty commit
dhwanis-crest Apr 12, 2023
6b6d84c
Minor Changes
dhwanis-crest Apr 12, 2023
8fb4033
Discarding the changes of connector and const file
dhwanis-crest Apr 12, 2023
fd9450b
Discarding the changes of connector and const file
dhwanis-crest Apr 12, 2023
b40152d
Discarding the changes of connector and const file
dhwanis-crest Apr 12, 2023
811c0ad
Adding the changes of connector and const file
dhwanis-crest Apr 12, 2023
ab32dff
targetting static test failure
dhwanis-crest Apr 13, 2023
43dfdd4
updated paginatin logic
hardik-crest Mar 19, 2024
6d2cd7b
updated copyright version and linting issues
hardik-crest Mar 19, 2024
2e86486
Update README.md
Mar 19, 2024
d117015
empty commit
hardik-crest Mar 19, 2024
69c1ed7
updated app version and release note
hardik-crest Mar 19, 2024
d8cee2e
Update README.md
Mar 19, 2024
ee51d5a
precommit changes
hardik-crest Mar 19, 2024
e25a629
Merge branch 'hchavda_servicenow_run_query_updates' of https://github…
hardik-crest Mar 19, 2024
d473df1
updated request params in get varaible action
hardik-crest Mar 20, 2024
71edb68
updated logic for pagination
hardik-crest Apr 15, 2024
da3b799
linitng changes
hardik-crest Apr 15, 2024
ff3c27b
updated linting changes
hardik-crest Apr 15, 2024
2dadd51
merged feature enhancement
hardik-crest Apr 16, 2024
106e630
Update README.md
Apr 16, 2024
69459fa
updated pagination logic
hardik-crest Apr 17, 2024
fabba2b
Added pagination for search sources action
mmomin-crest Apr 30, 2024
290fa8c
add verbose for search source and updated SERVICENOW_ERROR_FROM_SERVE…
mmomin-crest Apr 30, 2024
fabadf5
Update README.md
Apr 30, 2024
c19e7b4
Removed limit and page key-value from result and also add result if t…
mmomin-crest May 1, 2024
45744ba
Checking and breaking the loop if we got 1000 empty pages
mmomin-crest May 2, 2024
49859de
Upodate search sources pagination logic based on pages and use syspar…
mmomin-crest May 6, 2024
0168e66
Revert changes of get_variable action and update min_phantom_version
mmomin-crest Jun 3, 2024
b681264
Update README.md
Jun 3, 2024
2f58f70
Updated min_phantom_version
mmomin-crest Jun 20, 2024
4a0476a
Update README.md
Jun 20, 2024
bcd074b
Update example_values for search sources action
mmomin-crest Jun 24, 2024
65b3c75
Update README.md
Jun 24, 2024
dc6b8d0
Update release notes
mmomin-crest Jun 24, 2024
358e143
succinct the comments
mmomin-crest Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.16
rev: v1.18
hooks:
- id: org-hook
- id: package-app-dependencies
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--no-verify', '--exclude-files', '^servicenow.json$']
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright (c) 2016-2023 Splunk Inc.
Copyright (c) 2016-2024 Splunk Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
14 changes: 1 addition & 13 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
Splunk SOAR ServiceNow
Copyright (c) 2016-2023 Splunk Inc.
Copyright (c) 2016-2024 Splunk Inc.

Third-party Software Attributions:

Library: beautifulsoup4
Version: 4.9.1
License: MIT
Copyright 2004-2017 Leonard Richardson
Copyright 2004-2019 Leonard Richardson
Copyright 2018 Isaac Muse

Library: python-magic
Version: 0.4.18
License: MIT
Expand All @@ -21,8 +14,3 @@ License: MIT
License: Zope
Copyright 1987-2006 implementation only works for dates between
Copyright 2003-2019 Stuart Bishop <[email protected]>

Library: requests
Version: 2.25.0
License: Apache 2.0
Kenneth Reitz
94 changes: 85 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# ServiceNow

Publisher: Splunk
Connector Version: 2.5.0
Connector Version: 2.6.0
Product Vendor: ServiceNow
Product Name: ServiceNow
Product Version Supported (regex): ".\*"
Minimum Product Version: 6.1.0
Minimum Product Version: 6.2.1

This app integrates with ServiceNow to perform investigative and generic actions

Expand Down Expand Up @@ -211,6 +211,7 @@ VARIABLE | REQUIRED | TYPE | DESCRIPTION
[get variables](#action-get-variables) - Get variables for a ticket/record
[run query](#action-run-query) - Gets object data according to the specified query
[query users](#action-query-users) - Gets user data according to the specified query, username, or system ID
[search sources](#action-search-sources) - Search for records across multiple tables
[on poll](#action-on-poll) - Ingest tickets from SNOW

## action: 'test connectivity'
Expand Down Expand Up @@ -302,7 +303,7 @@ action_result.data.\*.depreciated_amount | string | | $0.00
action_result.data.\*.depreciation | string | |
action_result.data.\*.depreciation_date | string | |
action_result.data.\*.description | string | | My computer is not detecting the headphone device. It could be an issue with the USB port.
action_result.data.\*.display_name | string | | SW000077 - Microsoft ASP.NET 2011
action_result.data.\*.display_name | string | | SW000077 Test
action_result.data.\*.disposal_reason | string | |
action_result.data.\*.due | string | |
action_result.data.\*.due_date | string | |
Expand All @@ -329,7 +330,7 @@ action_result.data.\*.location | string | |
action_result.data.\*.made_sla | string | | true
action_result.data.\*.managed_by | string | |
action_result.data.\*.merged_into | string | |
action_result.data.\*.model.display_value | string | | Microsoft ASP.NET 2011
action_result.data.\*.model.display_value | string | | ASP.NET 2011
action_result.data.\*.model.link | string | | https://dev78070.service-now.com/api/now/table/cmdb_model/81bfae3f37601000deeabfc8bcbe5d2d
action_result.data.\*.model_category.display_value | string | | Software License
action_result.data.\*.model_category.link | string | | https://dev78070.service-now.com/api/now/table/cmdb_model_category/35bf2d4137101000deeabfc8bcbe5dbd
Expand Down Expand Up @@ -401,7 +402,7 @@ action_result.data.\*.upon_approval | string | | Proceed to Next Task
action_result.data.\*.upon_reject | string | | Cancel all future Tasks
action_result.data.\*.urgency | string | | 2 - Medium
action_result.data.\*.user_input | string | |
action_result.data.\*.vendor.display_value | string | | Microsoft
action_result.data.\*.vendor.display_value | string | | PRB000050 Test
action_result.data.\*.vendor.link | string | `url` | https://dev78070.service-now.com/api/now/table/core_company/0e8b8e650a0a0b3b004f285ffbb1a4fc
action_result.data.\*.warranty_expiration | string | |
action_result.data.\*.watch_list | string | |
Expand Down Expand Up @@ -1418,7 +1419,7 @@ PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
DATA PATH | TYPE | CONTAINS | EXAMPLE VALUES
--------- | ---- | -------- | --------------
action_result.status | string | | success failed
action_result.parameter.description | string | | Investigative actions to check for the presence of phapp_servicenow
action_result.parameter.description | string | | Switch occasionally drops connections
action_result.parameter.fields | string | | {"made_sla":true,"severity":3,"description":"This is testing description"}
action_result.parameter.short_description | string | | phapp_servicenow, Multiple action need to be taken
action_result.parameter.table | string | `servicenow table` | incident
Expand Down Expand Up @@ -2258,9 +2259,9 @@ action_result.data.\*.work_end | string | |
action_result.data.\*.work_notes | string | |
action_result.data.\*.work_notes_list | string | |
action_result.data.\*.work_start | string | |
action_result.summary.total_tickets | numeric | | 2 68
action_result.summary.total_tickets | numeric | | 2
action_result.message | string | | Important data: value
summary.total_objects | numeric | | 1 2
summary.total_objects | numeric | | 1
summary.total_objects_successful | numeric | | 1

## action: 'query users'
Expand Down Expand Up @@ -2297,7 +2298,7 @@ action_result.data.\*.date_format | string | |
action_result.data.\*.default_perspective | string | |
action_result.data.\*.department.link | string | `url` | https://dev116432.service-now.com/api/now/table/cmn_department/a581ab703710200044e0bfc8bcbe5de8
action_result.data.\*.department.value | string | `md5` | a581ab703710200044e0bfc8bcbe5de8
action_result.data.\*.email | string | `email` | herman@phantom.us
action_result.data.\*.email | string | `email` | abc@pqr.us
action_result.data.\*.employee_number | string | |
action_result.data.\*.enable_multifactor_authn | string | | false
action_result.data.\*.failed_attempts | string | | 0
Expand Down Expand Up @@ -2349,6 +2350,81 @@ action_result.message | string | | Total tickets: 1
summary.total_objects | numeric | | 1
summary.total_objects_successful | numeric | | 1

## action: 'search sources'
Search for records across multiple tables

Type: **investigate**
Read only: **True**

To find the list of search source IDs for the <b>sysparm_search_sources</b> parameter, follow this path in servicenow UI: All > Workspace Experience > Administration > Search Sources. Once there, click with two fingers/right click on the source name and copy the sys_id.

#### Action Parameters
PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
--------- | -------- | ----------- | ---- | --------
**sysparm_term** | required | Search record for the given term | string |
**sysparm_search_sources** | required | SYS ID of search sources, Comma-separated list allowed | string | `servicenow ticket sysid`

#### Action Output
DATA PATH | TYPE | CONTAINS | EXAMPLE VALUES
--------- | ---- | -------- | --------------
action_result.status | string | | success failed
action_result.parameter.sysparm_search_sources | string | `servicenow ticket sysid` | tec681c771testfedf0bcbe2c2606c
action_result.parameter.sysparm_term | string | | Resolved
action_result.data.\*.result_count | numeric | |
action_result.data.\*.search_results.\*.fields.\*.label | string | | Number
action_result.data.\*.search_results.\*.fields.\*.label_plural | string | | Numbers
action_result.data.\*.search_results.\*.fields.\*.max_length | numeric | | 40
action_result.data.\*.search_results.\*.fields.\*.name | string | | number
action_result.data.\*.search_results.\*.fields.\*.reference | string | | sys_user_group
action_result.data.\*.search_results.\*.fields.\*.type | string | | string
action_result.data.\*.search_results.\*.label | string | | Problem
action_result.data.\*.search_results.\*.limit | numeric | | 20
action_result.data.\*.search_results.\*.page | numeric | | 1
action_result.data.\*.search_results.\*.query | string | | 123TEXTQUEtest=Fix Applied
action_result.data.\*.search_results.\*.record_count | numeric | |
action_result.data.\*.search_results.\*.records.\*.data.assignment_group.display | string | |
action_result.data.\*.search_results.\*.records.\*.data.assignment_group.value | string | |
action_result.data.\*.search_results.\*.records.\*.data.caller_id.display | string | | System Administrator
action_result.data.\*.search_results.\*.records.\*.data.caller_id.value | string | | 6816f7test016401c5a33be04be441
action_result.data.\*.search_results.\*.records.\*.data.category.display | string | | Inquiry / Help
action_result.data.\*.search_results.\*.records.\*.data.category.value | string | | inquiry
action_result.data.\*.search_results.\*.records.\*.data.cmdb_ci.display | string | |
action_result.data.\*.search_results.\*.records.\*.data.cmdb_ci.value | string | |
action_result.data.\*.search_results.\*.records.\*.data.number.display | string | | INC000001
action_result.data.\*.search_results.\*.records.\*.data.number.value | string | | INC000001
action_result.data.\*.search_results.\*.records.\*.data.opened_at.display | string | | 2023-04-05 00:59:28
action_result.data.\*.search_results.\*.records.\*.data.opened_at.value | string | | 2023-04-05 07:59:28
action_result.data.\*.search_results.\*.records.\*.data.priority.display | string | | 5 - Planning
action_result.data.\*.search_results.\*.records.\*.data.priority.value | string | | 5
action_result.data.\*.search_results.\*.records.\*.data.related_incidents.display | string | | 0
action_result.data.\*.search_results.\*.records.\*.data.related_incidents.value | string | | 0
action_result.data.\*.search_results.\*.records.\*.data.resolution_code.value | string | |
action_result.data.\*.search_results.\*.records.\*.data.state.display | string | | New
action_result.data.\*.search_results.\*.records.\*.data.state.value | string | | 1
action_result.data.\*.search_results.\*.records.\*.data.sys_id.display | string | | c673edctest1106401f1e3f153af11
action_result.data.\*.search_results.\*.records.\*.data.sys_id.value | string | | td673test1106401f1e3f153af11
action_result.data.\*.search_results.\*.records.\*.metadata.description | string | |
action_result.data.\*.search_results.\*.records.\*.metadata.thumbnail_url | string | |
action_result.data.\*.search_results.\*.records.\*.metadata.title | string | | hello
action_result.data.\*.search_results.\*.records.\*.record_class_name | string | | incident
action_result.data.\*.search_results.\*.records.\*.record_url | string | | /incident.do?sys_id=test978221106401f1e99f11&sysparm_view=text_search
action_result.data.\*.search_results.\*.records.\*.sys_id | string | | c673ettest97822119953af11
action_result.data.\*.search_results.\*.records.\*.table | string | | incident
action_result.data.\*.search_results.\*.sys_id | string | | test897862996401f1e3f1990e
action_result.data.\*.search_results.\*.term | string | | Resolved
action_result.data.\*.sources.\*.condition.display | string | |
action_result.data.\*.sources.\*.condition.value | string | |
action_result.data.\*.sources.\*.name.display | string | | Tasks-Tickets
action_result.data.\*.sources.\*.name.value | string | | Tasks-Tickets
action_result.data.\*.sources.\*.source_table | string | | Problem
action_result.data.\*.sources.\*.sys_id | string | `servicenow ticket sysid` | test8699964099f153af0e99
action_result.data.\*.term | string | | Resolved
action_result.summary | string | |
action_result.summary.total_records | numeric | | 1
action_result.message | string | | Total records: 0
summary.total_objects | numeric | | 1
summary.total_objects_successful | numeric | | 1

## action: 'on poll'
Ingest tickets from SNOW

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: __init__.py
#
# Copyright (c) 2016-2023 Splunk Inc.
# Copyright (c) 2016-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 2 additions & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
**Unreleased**
* Fixed bug in pagination logic [PAPP-33317]
* Added new 'search sources' action support [PAPP-30131]
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
beautifulsoup4==4.9.1
python-magic==0.4.18
pytz==2021.1
Loading
Loading