{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":745,"path":"api-reference/server-api-reference/DevOpsOrchToolIntHandlerScopedAPI.md","title":"DevOpsOrchestrationToolIntegrationHandler - Scoped","bundle":null,"doc_type":null,"release":"australia","body":"\n# DevOpsOrchestrationToolIntegrationHandler- Scoped\n\nThe DevOpsOrchestrationToolIntegrationHandler API enables processing of payloads from custom DevOps tools.\n\nA custom DevOps tool is any tool that doesn't have an integration with DevOps. For a list of tools that have DevOps integrations, see [DevOps Change Velocity integrations](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/dev-ops-overview.md).\n\nThis API enables the processing of payloads that are used by the REST endpoint [DevOps - POST /devops/tool/\\{capability\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/devops-api.md). You must implement the methods of this API in a script include before calling the POST /devops/tool/\\{capability\\} endpoint.\n\nThis API executes in the `sn_devops` namespace. For more information about DevOps, see [DevOps Config](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/it-service-management/devops-config-landing-page.md).\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## DevOpsOrchestrationToolIntegrationHandler - getNativeIdForOrchestrationTask\\(Object payload\\)\n\nReturns the value of the **orchestrationTaskName** parameter from the payload for the POST /devops/tool/\\{capability\\} endpoint.\n\nYou must implement this method in a script include before calling the REST endpoint [DevOps - POST /devops/tool/\\{capability\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/devops-api.md).\n\n|Name|Type|Description|\n|----|----|-----------|\n|payload|Object|Payload containing data from the custom tool which is accepted by the REST endpoint POST /devops/tool/\\{capability\\}, where **capability** is `orchestration`.|\n\n|Type|Description|\n|----|-----------|\n|String|Value of the **orchestrationTaskName** parameter from the payload.|\n\nIn this example, a script include named `DevOpsOrchestrationCustomToolIntegrationHandler` implements the methods handleTool and getNativeIdForOrchestrationTask. The getNativeIdForOrchestrationTask method is implemented to return the value of the **orchestrationTaskName** parameter from the payload for POST /devops/tool/\\{capability\\}.\n\n```\nvar DevOpsOrchestrationCustomToolIntegrationHandler = Class.create(); \n\nDevOpsOrchestrationCustomToolIntegrationHandler.prototype = {     \n\n    handleTool: function(toolName) { \n        if (!gs.nil(toolName) && toolName == 'sn_devops_custom_tool') \n            return true; \n        return false; \n    }, \n\n    getNativeIdForOrchestrationTask: function(payload) { \n        return payload.orchestrationTaskName; \n    }, \n\n    type: 'DevOpsOrchestrationCustomToolIntegrationHandler' \n\n}; \n```\n\n## DevOpsOrchestrationToolIntegrationHandler - handleTool\\(String toolName\\)\n\nChecks if this handler is valid for the specified tool.\n\nYou must implement this method in a script include before calling [DevOps - POST /devops/tool/\\{capability\\}](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/devops-api.md).\n\n<table id=\"table_gtf_1vm_ctb\" class=\"parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ntoolName\n\n</td><td>\n\nString\n\n</td><td>\n\nName of the tool.Table: *Tool Name* field of the DevOps Tool Integration \\[sn\\_devops\\_tool\\_integration\\] table\n\n</td></tr></tbody>\n</table><table id=\"table_htf_1vm_ctb\" class=\"returns\"><thead><tr><th>\n\nType\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nBoolean\n\n</td><td>\n\nFlag that indicates whether this handler is valid for the specified tool.Possible values:\n\n-   true: This handler can be used for the specified tool.\n-   false: This handler can't be used for the specified tool.\n\n</td></tr></tbody>\n</table>In this example, a script include named `DevOpsOrchestrationCustomToolIntegrationHandler` implements the methods handleTool and getNativeIdForOrchestrationTask. The handleTool method is implemented to check that the passed in name is for the correct tool. Replace `'sn_devops_custom_tool'` with the name of the tool that you're using.\n\n```\nvar DevOpsOrchestrationCustomToolIntegrationHandler = Class.create(); \n\nDevOpsOrchestrationCustomToolIntegrationHandler.prototype = {     \n\n  handleTool: function(toolName) { \n    if (!gs.nil(toolName) && toolName == 'sn_devops_custom_tool') \n      return true; \n    return false; \n  }, \n\n  getNativeIdForOrchestrationTask: function(payload) { \n    return payload.orchestrationTaskName; \n  }, \n\n  type: 'DevOpsOrchestrationCustomToolIntegrationHandler' \n\n};\n```\n\n"}}