ケースを送信しているエージェント
このユースケースは、エージェントが既知の顧客のケースを送信できるようにする方法を示しています。
このシナリオでは、エージェントは FSO 苦情フォーム内から、リモート銀行アプリケーションにある顧客の口座情報を検索します。見つけると苦情フォーム内に表示され、エージェントは顧客の住宅ローン口座に関連するケースの詳細を手動で入力し、苦情ケースを保存します。バックグラウンドでは、フォームスクリプトが顧客の詳細と金融口座情報を ServiceNow インスタンスにローカルに保存します。
- コンシューマー [csm_consumer]:顧客レコードが含まれます。
- ローン口座 [sn_bom_loan_account]:各顧客のローン口座情報が含まれます。 注:ローン口座は金融口座の一種です。
以下は、エージェントが顧客に代わって苦情を申し立てる手順を説明する ServiceNow 苦情フォーム (ケースフォーム) の例です。このフォームでは、エージェントはフォームの [アカウント検索] ボタンをクリックして、顧客のアカウント情報を見つけます。
エージェントが [アカウント検索 ] をクリックすると、次のようなポップアップが表示されます。ポップアップでは、エージェントは表示された検索パラメーターのいずれかを使用して顧客のアカウントをルックアップできます。特定の Web サービスに基づいて独自の検索条件を作成できます。これらのWebサービスは通常、カスタマーマスターおよびアカウントマスターシステム、CRM、コアバンキングメインフレーム、およびFiserv、FIS、Jack Henry、FinastraなどのコアバンキングソフトウェアプロバイダーのAPIから提供されます。
検索では、この顧客の次のアカウントが返されます。
エージェントが適切なアカウントを選択すると、必要なアカウント情報がケースフォームに自動的に入力されます。エージェントは、顧客ケースを送信するために必要な追加情報を追加し、[ 送信] ボタンをクリックして苦情を ServiceNow インスタンスに保存します。
次の図は、このユースケースの REST API 呼び出しのフローを示し、必要な処理について簡単に説明します。
|
コード例
// Fetch consumers for the given first name and last name and associated
// financial accounts from the remote bank application
function fetchConsumers(consumer_fname, consumer_lname) {
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('get');
request.setEndpoint('api/getConsumerDetails?fname=consumer_fname&lname=consumer_lname');
var response = request.execute();
var responseBody = response.getBody();
var responseObj = JSON.parse(responseBody);
var consumers = responseObj.consumers;
// Create a record in the ServiceNow Consumer [csm_consumer] table for the specified consumer
var consumerDetails = [];
consumers.foreach(function(consumer){
var consumerGR = new GlideRecord('csm_consumer');
consumerGR.initialize();
consumerGR.setValue('uid', consumer.uid);
consumerGR.setValue('name', consumer.name);
consumerGR.setValue('email', consumer.email);
consumerGR.setValue('mobile', consumer.mobile);
consumerGR.setValue('address', consumer.address);
if(consumerGR.update()){
consumer.sysId = consumerGR.getValue('sys_id');
consumer.financialAccount = fetchFinancialAccountsForConsumer(consumer);
}
});
}
// Fetch financial accounts for the specified consumer
function fetchFinancialAccountsForConsumer(consumer) {
var financialAccounts = [];
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('get');
request.setEndpoint('api/getFinancialAccounts/' + consumer);
var response = request.execute();
var responseBody = response.getBody();
var responseObj = JSON.parse(responseBody);
var financialAccounts = responseObj.financialAccounts;
// Create a record in the ServiceNow financial_account table for each of the customer's financial accounts
financialAccounts.foreach(function(finAccount){
var finAccountGR = new GlideRecord('financial_account');
finAccountGR.initialize();
finAccountGR.setValue('uid', finAccount.uid);
finAccountGR.setValue('type', finAccount.type);
finAccountGR.setValue('number', finAccount.ac_number);
finAccountGR.setValue('balance', finAccount.balance);
if(finAccountGR.update()){
finAccount.sysId = finAccountGR.getValue('balance');
financialAccounts.push(finAccount);
}
});
return financialAccounts;
}
// The following retrieves an object to display in UI page
fnmae = ‘john’;
lname = ‘brown’;
var consumerObj = fetchConsumers(fname, lname);
consumerObj.foreach(function(consumer){
// Display the details on the page and populate it in the form as necessary
console.log(consumer);
});