Are Forge applications run on the server side?

I’d like to integrate a local API server behind the company firewall with Jira. It seems to me that this is impossible because Forge applications are run on the server side. Am I missing anything? Are there any solutions for integrating local micro-services with Jira?

1 Like

Have you checked out Custom UI? Forge will host just your front-end code and a user could call your microservice directly from their browser as long as you set up your egress controls correctly

2 Likes

Hi @BehzadSamadi,

Welcome to Developer Community. I’d like to check, are you talking about using Forge with your Jira Server/DC install or Jira Cloud?

Forge runs in an AWS lambda and need a Jira Cloud instance to be installed on. Do you want a Forge function to connect to your local services?

Or do you want to run Forge locally to connect to your Jira Server/DC install?

Regards,
James.

Hi @AdamMoore, I created a Custom UI app and inserted a console.log command but I could not see the output in the browser. I thought even the React app is part of the AWS Lambda function running on the server and just sending the resulting HTML back to Jira. I don’t see the API calls of the React app in the browser either. I was wondering if anyone has been able to inspect a Custom UI app in the browser.

Hi @jrichards, Thank you for your reply. I have a REST API server behind the company firewall. I would like to create a Forge app for Jira Cloud to exchange data with that service. So far, it seems that the REST API servers have to be publicly available to be called in a Forge app including Custom UI apps. Is that correct?

Hi @BehzadSamadi,

Yes, that is correct. As Forge runs in AWS they will need to be able to access the REST APIs internal to your network. You will need to open a hole up for Forge to make calls into your network.

I would highly recommend setting up an authentication mechanism along with firewall rules to only allow the Forge app to connect.

James.

1 Like

Thank you @jrichards :handshake:

Hi @BehzadSamadi , the static assets from your Custom UI app are served directly from the Atlassian CDN and displayed in the hosted iframe.

A Lambda is only involved if you’re using a backend resolver. If you put the console.log in the resolver then that might explain why you didn’t see it in your browser console.

Hi @AdamMoore , thank you for your response. I need to stand corrected: I can insert console.log commands in the React app and see the output in the browser.

I tried making an API call using fetch in the React app but it failed with this message:

Refused to connect to 'https://reqres.in/api/users/2' because it violates the following Content Security Policy directive: "connect-src 'self'".

Am I allowed to fetch in the React App?

I was able to run this fetch command in the React app:

const result = await fetch('https://reqres.in/api/users/2')

by adding these lines to manifest.xml:

permissions:
  external:
    fetch:
      client:
        - 'reqres.in'
  scopes: []
1 Like