Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,358
Community Members
 
Community Events
168
Community Groups

Make MySQL query in a Forge App

Hi, I'm developing an app for our cloud hosted Jira instance using Forge. I'm trying to connect the app to a MySQL database and pull + display some relevant information next to our tickets. I have MySQL server running in a Docker instance (everything with CLI).

Is that even possible? If so, how would it best be solved?

Right now I have a piece of code that tries to connect to the database after I press a button in the app. I get no errors and no response from the database (from what I can tell).

I can make MySQL queries using command line by connecting remotely using SSH.

This is my dbconnection.js located in 'src' folder, same as 'index.jsx':

(The settings provided in "pool" is randomized for privacy)

db.png

And this is how index.jsx looks like (slightly simplified):

index.png

Feels like I'm missing something critical. Would be greatly appreciative of any response!

1 answer

Hi @Simon Larson ,

By default, Forge's runtime is pretty locked down. You have to explicitly allow communications with the outside world, see here: https://developer.atlassian.com/platform/forge/runtime-egress-permissions/ 

Also, you will typically better answers to dev questions in the developer community. 

I must admit, I have not tried connecting directly to a backend database, but it looks intriguing. If you make it work, please let me and other know, because I'm sure a lot of devs would be interested.

Cheers,
 Oliver

Thanks for your reply @Oliver Siebenmarck _Polymetis Apps_.

I had a hunch this method was not the norm, but I will definitely play around with the link you provided and see if we can make something work.

What would be a more standard approach to allow for implicit app storage?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events