Skip to content

Script to Trigger Quick Discovery from Workflow / Flow #1100

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

Merged
merged 4 commits into from
Oct 2, 2024

Conversation

selvarun-umass
Copy link
Contributor

This code snippet automates the discovery of devices in ServiceNow using MID (Management, Instrumentation, and Discovery) servers by triggering Quick Discovery through a workflow. The code can also be modified for different workflows/ flows as needed.

Key features include:

MID Server Setup: It defines two MID servers to ensure redundancy, which improves the chances of successfully finding devices.

IP Address Retrieval: The code retrieves the IP address to be scanned from the current workflow context.

Discovery Process:

It creates a Discovery object to initiate the process. The script first attempts to find the device using the first MID server. If that fails, it logs a message and tries again with the second MID server. Logging and Status Update: After the discovery attempts, the script logs the results and updates the current context with the discovery status.

This code enhances device discovery in ServiceNow, making the process more reliable by utilizing multiple MID servers.

Script to trigger quick discovery from workflow or flow
Updated the README.md file
@snamjosh snamjosh self-assigned this Oct 2, 2024
@snamjosh snamjosh merged commit 8a9b3e4 into ServiceNowDevProgram:main Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants