We have Power Scripts for Confluence (SIL scripts) installed on our Confluence server. Confluence is linked to Jira with application link with Oauth impersonation.
Is is possible to use this link as authentication instead of basic authentication as explained in your example:
https://confluence.cprime.io/display/SIL/httpGet
//Create requestHttpRequest request;HttpHeader authHeader = httpBasicAuthHeader("admin", "admin");request.headers += authHeader; //Post data and get responseserverInfo si = httpGet("<a href="http://localhost:8080/rest/api/2/serverInfo?doHealthCheck=false" target="_blank" rel="nofollow noopener noreferrer">http://localhost:8080/rest/api/2/serverInfo?doHealthCheck=false</a>", request);return si.baseUrl;