Similar to the Confluence Project Key Query Page, I created another page for querying the Jira Project Key. As the script sends a cross domain request from Confluence to Jira, the CORS has to be configured in Jira to allow it. This is how it looks, and here is source code.