I'm trying to add plugin to JIRA cloud . And the plugin will be installed using ngrok.
Ideally this will be a frontend-only integration - meaning JIRA REST API will be accessed by the browser.
The desired flow is:
The first wall I hit is CORS error. How to solve this in JIRA cloud?
I read through the documentation and I can't find a way to achieve this.
Hi,
Use AP.request to make an XMLHttpRequest to the host product without requiring CORS.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://unpkg.com/@atlaskit/css-reset@2.0.0/dist/bundle.css" media="all">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/core.js" integrity="sha256-36hEPcG8mKookfvUVvEqRkpdYV1unP6wvxIqbgdeVhk=" crossorigin="anonymous"></script>
<script src="https://connect-cdn.atl-paas.net/all.js" async></script>
<script type="text/javascript">
async function start() {
var myResponse = await AP.request('https://jirasoftwaretest.atlassian.net/rest/api/3/issue/10002/');
}
start();
</script>
</head>
<body>
<section id="content" class="ac-content">
<h1>Hello World</h1>
</section>
</body>
</html>
This is my code. When i run this code, I am getting "Uncaught (in promise) ReferenceError: AP is not defined" error. How to fix it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.