A Connect app for integrating Figma designs into Jira.
- Implements the
Design
Connect module to enable linking/unlinking Figma designs to/from a Jira issue. - Implements design metadata sync from Figma to Jira for the configured Figma teams.
- Provides backwards compatibility with the previous versions of the app.
The app has been created based on the Atlassian Connect Node Example App.
- Prerequisites
- Getting started
- Installing the app
- Testing endpoints locally
- Database
- Testing
- Getting help
- License
- Install Node Version Manager (nvm).
- Install Docker & Docker Compose.
- Create an ngrok account.
- Install and use the target version of Node.js
nvm install
- Install the dependencies.
npm ci
- Create
.env
file based on.env.example
and set unset env variables. - Start the application sandbox.
npm run start:sandbox
- Start an ngrok tunnel (to make the app accessible by Jira).
npm run start:tunnel
ℹ️ NOTE: If you are using a free version of ngrok, please open the tunneled URL in browser and click on the Visit button. This needs to be done to bypass the ngrok browser warning.
- Start the app.
npm start
Open the Connect descriptor (${APP_URL}/atlassian-connect.json
) in your browser to verify that the app is up and
running.
- Ensure that the app is running locally (see Getting started).
- Choose Attach to Node.js configuration and click Debug.
Ensure that the app is running locally (see Getting started).
- Go to http://go.atlassian.com/cloud-dev and sign up (if you don't have your Jira instance). It may take several minutes to provision your site.
- Go to your Jira instance.
- Enable the installation of apps that are not listed on the Atlassian Marketplace.
- Go to Apps > Manage your apps.
- Click User-installed apps > Settings.
- Check Enable development mode and click Apply.
- Reload the page.
- Install the app.
- Go to App > Manage your apps > Upload app.
- Paste the link to your Connect descriptor (
${APP_URL}/atlassian-connect.json
) and click Upload.
These endpoints handle Connect lifecycle events and are called by Jira.
- Install a locally running app on your Jira instance to receive lifecycle event requests.
These endpoints implement the functionality required by admin UI (which is a part of the app).
- Install a locally running app on your Jira instance.
- In Jira, go to Apps > Manage your apps > Figma for Jira > Configure to open admin UI.
- Use admin UI to trigger requests to the endpoints.
These endpoints represent the implementation of the Design
Connect module
module and are called by Jira.
- Install a locally running app on your Jira instance.
- Open a Jira issue.
- Use the Designs panel to trigger requests to the endpoints.
If needed, you could test these APIs directly by mimicking Jira backend.
-
Install a locally running app on your Jira instance.
-
Find information about your Atlassian site and user.
- To find your
CLIENT_KEY
andSHARED_SECRET
, see thejira_connect_installation
database table. - To find your
ATLASSIAN_USER_ID
, open https://id.atlassian.com/gateway/api/me and seeaccount_id
. - To find your
ATLASSIAN_CLOUD_ID
, openhttps://${MY_SITE_NAME}.atlassian.net/_edge/tenant_info
and seecloudId
.
- To find your
-
Generate a JWT token for a target endpoint, e.g.:
npm run jira:jwt:symmetric:server:generate -- \ --clientKey "${CLIENT_KEY}" \ --sharedSecret "${SHARED_SECRET}" \ --method "GET" \ --endpoint "/auth/checkAuth?userId=${ATLASSIAN_USER_ID}"
npm run jira:jwt:symmetric:server:generate -- \ --clientKey "${CLIENT_KEY}" \ --sharedSecret "${SHARED_SECRET}" \ --method "POST" \ --endpoint "/entities/getEntityByUrl?userId=${ATLASSIAN_USER_ID}"
-
Use
cURL
or any other tool to call endpoints. Replace placeholders with real values in the commands below, e.g.:curl --request GET \ --url '${APP_URL}/auth/checkAuth?userId=${ATLASSIAN_USER_ID}' \ --header 'Authorization: JWT ${TOKEN}'
curl --request POST \ --url '${APP_URL}/entities/getEntityByUrl?userId=${ATLASSIAN_USER_ID}' \ --header 'Authorization: JWT ${TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "entity": { "url": "https://www.figma.com/file/${FILE_KEY}" } }'
curl --request PUT \ --url '${APP_URL}/entities/onEntityAssociated?userId=${ATLASSIAN_USER_ID}' \ --header 'Authorization: JWT ${TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "entity": { "id": "${FILE_KEY}", "ari": "NOT_USED" }, "associatedWith": { "ati": "ati:cloud:jira:issue", "ari": "ari:cloud:jira:${ATLASSIAN_CLOUD_ID}:issue/${JIRA_ISSUE_ID}", "cloudId": "${ATLASSIAN_CLOUD_ID}", "id": "${JIRA_ISSUE_ID}" } }'
curl --request PUT \ --url '${APP_URL}/entities/onEntityDisassociated?userId=${ATLASSIAN_USER_ID}' \ --header 'Authorization: JWT ${TOKEN}' \ --header 'Content-Type: application/json' \ --data '{ "entity": { "id": "${FILE_KEY}", "ari": "NOT_USED" }, "disassociatedFrom": { "ati": "ati:cloud:jira:issue", "ari": "ari:cloud:jira:${ATLASSIAN_CLOUD_ID}:issue/${JIRA_ISSUE_ID}", "cloudId": "${ATLASSIAN_CLOUD_ID}", "id": "${JIRA_ISSUE_ID}" } }'
The app uses Prisma as an ORM for interacting with a Postgres database.
-
Ensure that you have
.env
withPG_*
env variables set. -
Start the application sandbox:
npm run start:sandbox
-
Use IntelliJ Database tool or any other tool to connect to the database using the Postgres settings from the
.env
file.✅ TIP: If you aren't seeing the tables in IntelliJ, you may have to select the right schemas from the Schemas tab in the Data Sources window.
To run a database migration on your development environment:
- Ensure that the application sandbox is running.
npm run start:sandbox
- Make schema changes in
prisma/schema.prisma
. - Generate a new migration. You will be prompted to name the migration.
This will trigger
npm run db:migrate:dev
@prisma/client
regeneration. If you need to regenerate it manually, runnpm run db:generate
.
For more detail, see Prisma Docs - Developing with Prisma Migrate.
To run unit tests:
npm run test:unit
To run integration tests:
# Spin up a sandbox for integration tests.
npm run start:sandbox:test
# Run integration tests.
npm run test:it
If you have feedback, found a bug, or need some help, please create a new issue in this repo.
The project is available as open source under the terms of the Apache 2.0 License.