code: public static JiraRestClient connect(URL jiraUrl, String username, String password) throws IOException {
          return new AsynchronousJiraRestClientFactory()
                  .createWithBasicHttpAuthentication(URI.create(jiraUrl.toExternalForm()), username, password);
      }
docs: Connects to the JIRA server.