Skip to content

Commit

Permalink
Fixed bug in the mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
fokolo committed Dec 25, 2024
1 parent 0f57559 commit 4a7afd4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backstage-plugins/plugins/frontend-plugin/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 7 additions & 2 deletions backstage-plugins/plugins/frontend-plugin/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -217,7 +218,11 @@ export class PortAPI {
return json.integrations;
}

async updateIntegration(identifier: string, config: string): Promise<any> {
async updateIntegration(
identifier: string,
configYAML: string,
): Promise<any> {
const config = yaml.parse(configYAML);
const response = await this.fetchApi.fetch(
this.getUrl(`/integration/${identifier}/config`),
{
Expand All @@ -226,7 +231,7 @@ export class PortAPI {
headers: {
'Content-Type': 'application/json',
},
body: config,
body: JSON.stringify({ config }),
},
);

Expand Down
7 changes: 6 additions & 1 deletion docs/site/docs/examples/dev-daily.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ Now click on the `MAPPING` button near the **Jira** integration. and paste the f
<details>
<summary>Task Mapping</summary>

:::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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/site/docs/integrations/jira.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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://<your-jira-instance>.atlassian.net`.
- **Jira Host**: Usually it's `https://<your-jira-instance>.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.
Expand Down

0 comments on commit 4a7afd4

Please sign in to comment.