{"_id":"@axis-backstage-staging/plugin-jira-dashboard-backend","name":"@axis-backstage-staging/plugin-jira-dashboard-backend","dist-tags":{"latest":"0.7.2"},"versions":{"0.7.2":{"name":"@axis-backstage-staging/plugin-jira-dashboard-backend","version":"0.7.2","main":"src/index.ts","types":"src/index.ts","license":"Apache-2.0","publishConfig":{"access":"public","main":"dist/index.cjs.js","types":"dist/index.d.ts"},"backstage":{"role":"backend-plugin"},"scripts":{"start":"backstage-cli package start","build":"backstage-cli package build","lint":"backstage-cli package lint","test":"backstage-cli package test","clean":"backstage-cli package clean","prepack":"backstage-cli package prepack","postpack":"backstage-cli package postpack"},"dependencies":{"@axis-backstage-staging/plugin-jira-dashboard-common":"workspace:^","@backstage/backend-common":"^0.20.1","@backstage/backend-plugin-api":"^0.6.9","@backstage/catalog-client":"^1.5.2","@backstage/catalog-model":"^1.4.3","@backstage/config":"^1.1.1","@backstage/plugin-auth-node":"^0.4.3","@backstage/plugin-permission-common":"^0.7.12","@types/express":"*","express":"^4.17.1","express-promise-router":"^4.1.0","node-fetch":"^2.6.7","winston":"^3.2.1","yn":"^4.0.0"},"devDependencies":{"@backstage/cli":"^0.25.1","@types/supertest":"^2.0.12","msw":"^1.0.0","supertest":"^6.2.4"},"configSchema":"config.d.ts","_id":"@axis-backstage-staging/plugin-jira-dashboard-backend@0.7.2","gitHead":"cc32eb925bac4c544aa398d29e0edced640c3264","description":"A plugin that makes requests to [Atlassian REST API](https://developer.atlassian.com/server/jira/platform/rest-apis/) to get issues and project information from Jira.","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-59gTw+jEuZ0TCQrbVizskyCYFVu5UkEnaSwFTKSnxJrK/0udcyMqUwtrJtRIKW5Zags9zT4rnYfEW3nV/+JsNg==","shasum":"53d624a942ce6918736a35518069e4ae20592c39","tarball":"https://registry.npmjs.org/@axis-backstage-staging/plugin-jira-dashboard-backend/-/plugin-jira-dashboard-backend-0.7.2.tgz","fileCount":6,"unpackedSize":51828,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBn6X47aZ6B69lokY4W2nvp6YXOG8deKSs8jux+oCpPAAiEA93GwBEwnRTI6lWYLZhEMZPGfKUkqZ/OPyrBditUz0aU="}]},"_npmUser":{"name":"glundh","email":"gustaf.lundh@axis.com"},"directories":{},"maintainers":[{"name":"glundh","email":"gustaf.lundh@axis.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-jira-dashboard-backend_0.7.2_1711036856969_0.9087313055244441"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-21T16:00:56.880Z","0.7.2":"2024-03-21T16:00:57.131Z","modified":"2024-03-21T16:00:57.672Z"},"maintainers":[{"name":"glundh","email":"gustaf.lundh@axis.com"}],"description":"A plugin that makes requests to [Atlassian REST API](https://developer.atlassian.com/server/jira/platform/rest-apis/) to get issues and project information from Jira.","license":"Apache-2.0","readme":"# Jira Dashboard Backend\n\nA plugin that makes requests to [Atlassian REST API](https://developer.atlassian.com/server/jira/platform/rest-apis/) to get issues and project information from Jira.\n\nThe frontend plugin that displays this information is [Jira Dashboard](https://github.com/AxisCommunications/backstage-plugins/blob/main/plugins/jira-dashboard).\n\n## Setup\n\nThe following sections will help you get the Jira Dashboard Backend plugin setup and running.\n\n### Installation\n\nInstall the plugin by following the example below:\n\n```bash\n# From your Backstage root directory\nyarn --cwd packages/backend add @axis-backstage/plugin-jira-dashboard-backend\n```\n\n### Configuration\n\nThe Jira Dashboard plugin requires the following YAML to be added to your app-config.yaml:\n\n```yaml\njiraDashboard:\n  token: ${JIRA_TOKEN}\n  baseUrl: ${JIRA_BASE_URL}\n  userEmailSuffix: ${JIRA_EMAIL_SUFFIX}\n  annotationPrefix: ${JIRA_ANNOTATION_PREFIX} # Optional\n```\n\n#### Configuration Details:\n\n- `JIRA_TOKEN`: The API token to authenticate towards Jira. It can be found by visiting Atlassians page at https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/. In case you are using a Bearer or Basic token, you need to add it in the beginning of the token. For instance: `Bearer your-secret-token`\n  > Note: The JIRA_TOKEN variable from [Roadie's Backstage Jira plugin](https://roadie.io/backstage/plugins/jira) can not be reused here because of the added encoding in this token.\n- `JIRA_BASE_URL`: The base url for Jira in your company, including the API version. For instance: https://jira.se.your-company.com/rest/api/2/\n- `JIRA_EMAIL_SUFFIX`: The email suffix used for retrieving a specific Jira user in a company. For instance: @your-company.com\n- `JIRA_ANNOTATION_PREFIX`: Optional annotation prefix for retrieving a custom annotation. Defaut value is jira.com. If you want to configure the plugin to be compatible with [Roadie's Backstage Jira Plugin](https://roadie.io/backstage/plugins/jira/), use the following annotation prefix:\n\n```yaml\njiraDashboard:\n   {/* required configs... */}\n  annotationPrefix: jira\n```\n\n### Integrating\n\nHere's how to get the backend plugin up and running:\n\n1. Create a new file named `packages/backend/src/plugins/jiraDashboard.ts`, and add the following to it:\n\n   ```ts\n   import { createRouter } from '@axis-backstage/plugin-jira-dashboard-backend';\n   import { Router } from 'express';\n   import { PluginEnvironment } from '../types';\n\n   export default async function createPlugin(\n     env: PluginEnvironment,\n   ): Promise<Router> {\n     return await createRouter({\n       logger: env.logger,\n       config: env.config,\n       discovery: env.discovery,\n       identity: env.identity,\n       tokenManager: env.tokenManager,\n     });\n   }\n   ```\n\n2. Wire this into the overall backend router by adding the following to `packages/backend/src/index.ts`:\n\n   ```ts\n   import jiraDashboard from './plugins/jiraDashboard';\n   ...\n\n   async function main() {\n     // Add this line under the other lines that follow the useHotMemoize pattern\n    const jiraDashboardEnv = useHotMemoize(module, () => createEnv('jira-dashboard'),\n\n     // Add this under the lines that add their routers to apiRouter\n    apiRouter.use('/jira-dashboard', await jiraDashboard(jiraDashboardEnv));\n   }\n   ```\n\n3. Now run `yarn start-backend` from the repo root.\n\n4. In another terminal, run the command: `curl localhost:7007/api/jira-dashboard/health`. The request should return `{\"status\":\"ok\"}`.\n\n### New Backend System\n\nThe Jira Dashboard backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/). Here is how you can set it up:\n\nIn your `packages/backend/src/index.ts` make the following changes:\n\n```diff\n+ import { jiraDashboardPlugin } from '@axis-backstage/plugin-jira-dashboard-backend';\n\nconst backend = createBackend();\n+ backend.add(jiraDashboardPlugin());\n// ... other feature additions\n\nbackend.start();\n```\n","readmeFilename":"README.md"}