From 4a7afd4ada97fcf089e352896b8241ab2ea1ebaa Mon Sep 17 00:00:00 2001 From: Roi Talpaz <2651169+fokolo@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:08:25 +0200 Subject: [PATCH] Fixed bug in the mapping --- backstage-plugins/plugins/frontend-plugin/package.json | 2 +- .../plugins/frontend-plugin/src/api/index.ts | 9 +++++++-- docs/site/docs/examples/dev-daily.md | 7 ++++++- docs/site/docs/integrations/jira.mdx | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/backstage-plugins/plugins/frontend-plugin/package.json b/backstage-plugins/plugins/frontend-plugin/package.json index 7c6570eea..28b318b75 100644 --- a/backstage-plugins/plugins/frontend-plugin/package.json +++ b/backstage-plugins/plugins/frontend-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@port-labs/backstage-plugin-framework", - "version": "0.1.5", + "version": "0.1.6", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/backstage-plugins/plugins/frontend-plugin/src/api/index.ts b/backstage-plugins/plugins/frontend-plugin/src/api/index.ts index 01e23ab0c..8c4d736e9 100644 --- a/backstage-plugins/plugins/frontend-plugin/src/api/index.ts +++ b/backstage-plugins/plugins/frontend-plugin/src/api/index.ts @@ -6,6 +6,7 @@ import { IdentityApi, } from '@backstage/core-plugin-api'; import { CatalogApi } from '@backstage/plugin-catalog-react'; +import yaml from 'yaml'; import { Action, Blueprint, @@ -217,7 +218,11 @@ export class PortAPI { return json.integrations; } - async updateIntegration(identifier: string, config: string): Promise { + async updateIntegration( + identifier: string, + configYAML: string, + ): Promise { + const config = yaml.parse(configYAML); const response = await this.fetchApi.fetch( this.getUrl(`/integration/${identifier}/config`), { @@ -226,7 +231,7 @@ export class PortAPI { headers: { 'Content-Type': 'application/json', }, - body: config, + body: JSON.stringify({ config }), }, ); diff --git a/docs/site/docs/examples/dev-daily.md b/docs/site/docs/examples/dev-daily.md index 5067038ad..2f57b36b6 100644 --- a/docs/site/docs/examples/dev-daily.md +++ b/docs/site/docs/examples/dev-daily.md @@ -183,6 +183,11 @@ Now click on the `MAPPING` button near the **Jira** integration. and paste the f
Task Mapping +:::note +The `jql` query (in line 8) is used to filter the issues that will be mapped to the blueprint. +Feel free to change it to your needs. in this example we are mapping issues that were created or updated in the last 3 weeks. +::: + ```yaml deleteDependentEntities: true createMissingRelatedEntities: true @@ -191,7 +196,7 @@ resources: - kind: issue selector: query: "true" - jql: (created >= -1w) OR (updated >= -1w) + jql: (created >= -3w) OR (updated >= -3w) port: entity: mappings: diff --git a/docs/site/docs/integrations/jira.mdx b/docs/site/docs/integrations/jira.mdx index ac5a1d280..48848ae4c 100644 --- a/docs/site/docs/integrations/jira.mdx +++ b/docs/site/docs/integrations/jira.mdx @@ -11,7 +11,7 @@ title: Jira Integration 5. Fill out the form: - **Name**: Give your integration a name. (You can pick "jira") - **Installation Method**: Select **Hosted by Port**. For more advanced setups, read [here](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/project-management/jira/?installation-methods=real-time-self-hosted#setup) - - **Jira Host**: Usually it's `https://.atlassian.net`. + - **Jira Host**: Usually it's `https://.atlassian.net/`. - **Atlassian User Email**: The email of the user you want to use to authenticate with Jira. - **Atlassian API Token**: The API Token you obtained for the user. 6. Click on the **Save** button.