automation-hub
2021.10
false
Importante :
A tradução automática foi aplicada parcialmente neste conteúdo.
UiPath logo, featuring letters U and I in white
Fora do período de suporte
Guia da API do Automation Hub
Automation CloudAutomation Cloud Public SectorAutomation Suite
Last updated 11 de nov de 2024

Tutorial em vídeo de integração de saída do Service Now

Breve descrição:este vídeo apresenta como obter uma integração básica entre o Service Now e o Automation Hub, usando a Open API e acionando a criação de ideias a partir dos Tickets do Service Now.

Os tópicos principais são:

  • 00:00 — Introdução;

  • 01:30 — Configurando campos personalizados para um questionário do Automation Hub na tabela de incidentes;

  • 05:40 — Configurando a regra de negócios que realiza a chamada da API para o Automation Hub;

  • 10:50 — Criando um novo incidente e testando a regra;

  • 13:10 — Verificando a saída diretamente no Automation Hub.

Código usado na configuração do Service Now

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());

Esta página foi útil?

Obtenha a ajuda que você precisa
Aprendendo RPA - Cursos de automação
Fórum da comunidade da Uipath
Uipath Logo White
Confiança e segurança
© 2005-2024 UiPath. Todos os direitos reservados.