Creating DevOps subflows
Summarize
Summary of Creating DevOps subflows
This guide outlines the process for creating DevOps Flow Designer subflows in ServiceNow, enabling users to integrate data from various third-party tools. It emphasizes utilizing the Flow Designer to automate processes through a sequence of actions triggered by specific conditions.
Show less
Key Features
- Data Transformation: The subflow allows for collecting and transforming data, storing the final output in a specified field.
- Notification Capability: The subflow can handle JSON payloads from various tools, including planning, coding, orchestration, and testing tools, with specific expected formats provided.
- Connect Capability: The subflow can establish connections to various tools, providing feedback on connection success or failure.
- Discover Capability: This feature supports retrieving information from third-party tools, including pagination for managing large datasets.
- Update Import Request: Users can modify the state of the Import Request record within the subflow, enabling better tracking of integration processes.
Key Outcomes
By implementing DevOps subflows, ServiceNow customers can achieve seamless integration with external tools, automate data collection and transformation processes, and enhance their overall DevOps efficiency. The structured handling of notifications and connection establishment improves visibility and control over integrations, leading to faster and more reliable development cycles.
For user-created integrations, create a DevOps Flow Designer subflow to collect and transform data from the tool you are integrating.
ServiceNow Flow Designer is a ServiceNow AI Platform feature your integration developer can use to automate processes using a sequence of actions. Trigger conditions start the flow, and variables pass information between actions.
See Flow Designer Subflows for information on how to create a subflow.
Notification capability subflow
| Item | Expected value |
|---|---|
| Inputs | Label: current Type: Reference.Inbound Event |
Outputs |
N/A |
Transform the original payload, and save the final payload in the transformed_payload field.
- Expected standard JSON Notification capability payload - Planning tool
- Note:The version attribute in the JSON payload is optional. Even if you do not provide the version attribute, the payload is processed successfully.
{ "id": "STR1234", "type": "Story", "shortDescription": "Planning API Spec", "state": "In-progress", "createdDateTime": "1970-01-01T08:15:30-05:00", "assignedTo": { "name": "Leo Neo", "userName": "lenn", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "email": "lenn@smithworksinc.com" }, // The Version attribute is optional "version": { "id": "REL1234", "shortDescription": "APIs Release", "createdDateTime": "1970-01-01T08:15:30-05:00", "app": { "id": "PRODUCT1234", "shortDescription": "Mobile UI", "createdDateTime": "1970-01-01T08:15:30-05:00", "url": "https://jira.com/mycompany/browse/PRODUCT-125" }, "url": "https://jira.com/mycompany/browse/REL-125" }, "app": { "id": "PRODUCT1234", "shortDescription": "Mobile UI", "createdDateTime": "1970-01-01T08:15:30-05:00", "url": "https://jira.com/mycompany/browse/PRODUCT-125" }, "url": "https://jira.com/mycompany/browse/HALOKEY-25" } - Expected standard JSON Notification capability payload - Coding tool
{ "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "url": "https://github.com/mycompany/mobileplatform/commit/3fa85f6457174562b3fc2c963f66afa6", "committedDate": "1970-01-01T08:15:30-05:00", "repository": { "name": "Platform-Mobile", "url": "https://github.com/mycompany/mobileplatform" }, "branch": { "name": "master", "path": "refs/heads/master" }, "committer": { "email": "lenn@smithworksinc.com" }, "details": [ { "additions": 0, "deletions": 0, "totalChanges": 0, "file": "src/test/java/com/mycompany/app/App.java", "action": "modified", "changes": "%40%40%20-30%2C6%20%2B30%2C18%20%40%40%20public%20void%20testAppConstructor%28%29%20%7B%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%7D%0A%20%0A%2B%20%20%20%20%40Test%0A%2B%20%20%20%20public%20void%20testDatabase%28%29%0A%2B%20%20%20%20%7B%0A%2B%09%2F%2FThis%20is%20a%20test%20function%0A%2B%20%20%20%20%20%20%20%20App.main%28null%29%3B%0A%2B%20%20%20%20%20%20%20%20try%20%7B%0A%2B%20%20%20%20%20%20%20%20%20%20%20%20assertEquals%28%22Hello%20World%21%22%20%2B%20System.getProperty%28%22line.separator%22%29%2C%20outContent.toString%28%29%29%3B%0A%2B%20%20%20%20%20%20%20%20%7D%20catch%20%28AssertionError%20e%29%20%7B%0A%2B%20%20%20%20%20%20%20%20%20%20%20%20fail%28%22%22message%22%20is%20not%20%22Hello%20World%21%22%22%29%3B%0A%2B%20%20%20%20%20%20%20%20%7D%0A%2B%20%20%20%20%7D%0A%2B%0A%20%20%20%20%20%40Test%0A%20%20%20%20%20public%20void%20testAppMain%28%29%0A%20%20%20%20%20%7B" } ] }- Expected standard JSON Notification capability payload - Orchestration tool
{ "toolId": "bc1d9454dbdb0810ae77f3c61d9619d1", "buildNumber": "100", "nativeId": "HILR/Prod #100", "name": "HILR/Prod", "id": "HILR/Prod #100", "url": "https://dev.azure.com/lenn/CorpSite-ADO/_build/results?buildId=100#Prod/", "isMultiBranch": "false", "orchestrationTaskUrl": "https://dev.azure.com/lenn/CorpSite-ADO/_build?name=HILR#Prod", "orchestrationTaskName": "CorpSite-ADO/HILR#Prod", "upstreamTaskUrl": "https://dev.azure.com/lenn/CorpSite-ADO/_build/results?buildId=100#UAT/", "upstreamId": "CorpSite-ADO/HILR#UAT", "result": "building", "startDateTime": "2020-03-20 22:59:27" }- Expected standard JSON Notification capability payload - Test tool
- Functional:
{ "name": "CorpSite-selenium#55", "duration": 78.802, "passedTests": 4, "failedTests": 0, "skippedTests": 0, "blockedTests": 0, "totalTests": 4, "startTime": "2020-06-30T18:12:31Z", "finishTime": "2020-06-30T18:12:31Z", "passingPercent": 100, // Use Artifact OR Package OR Build + Stage + PipelineName Attributes "packages": [{"name": "CorpSite-pkg1"}], "artifacts": [{"name": "CorpSite-artifact", "version": "1.0.0"}], "buildNumber": "55", "stageName": "test", "pipelineName": "CorpSite-selenium", }Performance:{ "name": "Performance Tests", "url": "http://abc.com", "startTime": "2020-06-30T18:12:31Z", "finishTime": "2020-06-30T18:12:31Z", "duration": 78.802, "maximumVirtualUsers": "", "throughput": "", "maximumTime": "", "minimumTime": "", "averageTime": "", "ninetyPercent": "", "standardDeviation": "", // Use Artifact OR Package OR Build + Stage + PipelineName Attributes "packages": [{"name": "CorpSite-pkg1"}], "artifacts": [{"name": "CorpSite-artifact", "version": "1.0.0"}], "buildNumber": "55", "stageName": "test", "pipelineName": "CorpSite-Performance", } - Expected standard JSON Notification capability payload - Artifact tool
- Pipelines:
{ "artifacts": [ { "name": "acm.jar", "version": "1.82", "semanticVersion": "1.82.0", "repositoryName": "acm-repo" } ], "pipelineName": "testMultiBranch/master", "taskExecutionNumber": "82", "stageName": "buildmbmaster", "branchName": "master" }Jenkins Freestyle/Maven Project:{ "artifacts": [ { "name": "mav1.jar", "version": "1.11", "semanticVersion": "1.11.0", "repositoryName": "mav-repo" } ], "projectName": "maven-test-proj", "taskExecutionNumber": "11" }
Connect capability subflow
The Connect capability is supported.
| Item | Expected value |
|---|---|
| Inputs | Label: current Type: Reference.DevOps Tool Tool record for which the Connect button action is clicked. |
Outputs See subflow outputs. |
|
- Connection failed
- Subflow was executed successfully but the connection could not be made.
- Error: Failed to get failure details from the tool specific connect flow
- Subflow execution failed for an unknown reason.
- Error updating the tool connect status
- The connection_state attribute could not be updated for an unknown reason.
Discover capability subflow
The Discover capability is supported.
| Item | Expected value |
|---|---|
| Inputs | Label: current Type: Reference.DevOps Tool |
Outputs See subflow outputs. |
Without pagination: Label: discoverpayload Type: Array of objects as JSON string. (JSON.stringify([{},{}])) Planning tool without pagination: Coding tool without pagination:
Orchestration tool without pagination:
With pagination: Label: discoverpayload Type: Array of objects as JSON string. (JSON.stringify([{},{}])) Sample JSON format:
Planning tool with pagination:
Coding tool with pagination:
Orchestration tool with pagination: |
| State | Message |
|---|---|
| Requested | -- |
| Processing | -- |
| Completed | Updated <number> object(s) Found <number> objects with invalid toolId Found <number> objects failed validation |
| Error |
|
| Paused | -- |
| Canceled | -- |
| Unmatched | -- |
Update Import Request Flow Designer action
You can use the Update Import Request action in your Discover subflow to modify the Import Request record state, if desired.
| Input label | Type |
|---|---|
| current | Reference.Import Request |
| state | (String)
|
| details | (String) |