HTTP request with authentication: Migrate to new JSScripting

Hi all

I have already migrated all my rules to new ECMAScript-2021. But here I’m stuck:

var client =;
function httpGet(uri) {
  try {
    var request =
      .header("Authorization", "Bearer XXX")
      .header("Content-Type", "application/json")
    var response = client.send(request,;
    // print(response.body());
    return response;
  } catch (e) {

var result = JSON.parse(httpGet("https://XXX").body());

Example is from here:

This is the error I get in Log with 1:1 copy:

Failed to execute script:
org.graalvm.polyglot.PolyglotException: java.lang.IllegalStateException: java.lang.IllegalAccessException: access to public member failed:[Ljava.lang.Object;@182b34d/invokeVirtual, from public Lookup

Any help is appreciated :slight_smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.