Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I'm trying to add plugin to JIRA cloud . And the plugin will be installed using ngrok. Ideally this

Shreekanth B June 30, 2019

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:

  1. When user clicks on my plugin, it should retrieve information about issues using REST API.
  2. REST API call is as follows: https://myatlassian.net/rest/api/3/issue/10002

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.

2 answers

1 vote
Aleksandr Zuevich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2019

Hi,

Use AP.request to make an XMLHttpRequest to the host product without requiring CORS.

Sahana Rama Hegde July 1, 2019

<!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?

0 votes
Sahana Rama Hegde July 3, 2019

It worked!! Thanks

Suggest an answer

Log in or Sign up to answer