automation-hub
latest
false
ServiceNow アウトバウンド連携のビデオ チュートリアル
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。
Automation Hub API ガイド (公共部門向け)
ServiceNow アウトバウンド連携のビデオ チュートリアル
簡単な説明: このビデオでは、OpenAPI を使用して ServiceNow のチケットからアイデアの作成をトリガーし、ServiceNow と Automation Hub の基本的な連携を実現する方法を説明します。
主なトピックは以下のとおりです。
-
00:00 - 概要
-
01:30 - インシデント テーブルに Automation Hub の質問項目のカスタム フィールドを設定する
-
05:40 - Automation Hub への API 呼び出しを実行するビジネス ルールを設定する
-
10:50 - 新しいインシデントを作成し、ルールをテストする
-
13:10 - 出力を Automation Hub で直接確認する
ServiceNow の設定で使用されるコード
var params = {
"process_name": current.getDisplayValue()+" - "+current.short_description.toString(),
"process_description": current.short_description.toString(),
"category_id": parseInt(current.u_ah_business_area),
"rules": parseInt(current.u_ah_how_rule_based_is_your_task),
"input_type": parseInt(current.u_ah_how_would_you_describe_the_input_data_for_your_task_process),
"input_quality": parseInt(current.u_ah_how_would_you_describe_the_structure_of_your_input_data),
"stability": parseInt(current.u_ah_changes_in_the_next_6_months),
"documentation": parseInt(current.u_ah_documentation_type),
"owner": current.u_ah_process_owner.toString()
};
var json = new JSON();
var text = json.encode(params);
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://rpanavigator-pentest-open-api.azurewebsites.net/api/v1/openapi/automationidea');
request.setHttpMethod('POST');
request.setRequestHeader("Accept","application/json");
request.setRequestHeader("Content-Type","application/json");
request.setRequestHeader("x-ah-openapi-app-key","userapi");
request.setRequestHeader("x-ah-openapi-auth","openapi-token");
request.setRequestHeader("Authorization","Bearer 4ec2bd1f-af111111111111111/411497b2-cfa3-454d-1111111111111");
request.setRequestBody(text);
var requestBody = request.getRequestBody();
var response = request.execute();
var responseBody = response.getBody();
var responseObj = JSON.parse(responseBody);
var tenantURL = 'https://preprod-automation-hub.uipath.com/integrations_change/';
current.description = current.description+" /Info from Automation Hub:/"+responseObj.statusCode+" "+responseObj.message+"//Process url: "+tenantURL+responseObj.data.process_slug+"//Process name:"+responseObj.data.process_name;
current.update();
gs.log(response.getBody());
var params = {
"process_name": current.getDisplayValue()+" - "+current.short_description.toString(),
"process_description": current.short_description.toString(),
"category_id": parseInt(current.u_ah_business_area),
"rules": parseInt(current.u_ah_how_rule_based_is_your_task),
"input_type": parseInt(current.u_ah_how_would_you_describe_the_input_data_for_your_task_process),
"input_quality": parseInt(current.u_ah_how_would_you_describe_the_structure_of_your_input_data),
"stability": parseInt(current.u_ah_changes_in_the_next_6_months),
"documentation": parseInt(current.u_ah_documentation_type),
"owner": current.u_ah_process_owner.toString()
};
var json = new JSON();
var text = json.encode(params);
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://rpanavigator-pentest-open-api.azurewebsites.net/api/v1/openapi/automationidea');
request.setHttpMethod('POST');
request.setRequestHeader("Accept","application/json");
request.setRequestHeader("Content-Type","application/json");
request.setRequestHeader("x-ah-openapi-app-key","userapi");
request.setRequestHeader("x-ah-openapi-auth","openapi-token");
request.setRequestHeader("Authorization","Bearer 4ec2bd1f-af111111111111111/411497b2-cfa3-454d-1111111111111");
request.setRequestBody(text);
var requestBody = request.getRequestBody();
var response = request.execute();
var responseBody = response.getBody();
var responseObj = JSON.parse(responseBody);
var tenantURL = 'https://preprod-automation-hub.uipath.com/integrations_change/';
current.description = current.description+" /Info from Automation Hub:/"+responseObj.statusCode+" "+responseObj.message+"//Process url: "+tenantURL+responseObj.data.process_slug+"//Process name:"+responseObj.data.process_name;
current.update();
gs.log(response.getBody());