Skip to content

Commit

Permalink
Apply minor improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
chathurace authored Dec 18, 2023
1 parent 8f38f35 commit e1d4b2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions servicenow-case-to-salesforce-case/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ function calculateFetchingPeriod() returns DateRange|error {
return {'start, end, now};
}

function fetchCasesFromServiceNow(string fetchFrom, string fetchTill) returns CaseData[]|error {
string query = string `sys_created_onBETWEENjavascript:gs.dateGenerate(${fetchFrom})@javascript:gs.dateGenerate(${fetchTill})`;
function fetchCasesFromServiceNow(string fetchFrom, string fetchTill) returns CaseData[]|error {
http:Client servicenow = check new (string `https://${servicenowInstance}.service-now.com/api/sn_customerservice`);
string serviceNowCredentials = check mime:base64Encode(serviceNowUsername + ":" + serviceNowPassword, "UTF-8").ensureType();
string query = string `sys_created_onBETWEENjavascript:gs.dateGenerate(${fetchFrom})@javascript:gs.dateGenerate(${fetchTill})`;
record {CaseData[] result;} caseResponse = check servicenow->/case(
headers = {"Authorization": "Basic " + serviceNowCredentials},
sysparm_query = check url:encode(query, "UTF-8")
Expand Down

0 comments on commit e1d4b2c

Please sign in to comment.