Nico
Nico

Reputation: 115

Jira integration in Backstage giving 404 error

I'm currently testing Backstage for my company, and I tried various continuous integration pipelines like Github, Jira, Jenkins, and more. But I'm facing an issue with the Jira plugin. Maybe it's just a bad setup.

In my component, I can see the Jira entity, but every time, it says:

failed to fetch data, status 404: Not Found

When I look in the browser's console (network), I can see this 404, and this is the query used:

http://localhost:7007/api/proxy/jira/api/rest/api/latest/project/undefined

Why do I have undefined? Is it because the jira/project-key variable is not at the right place? Actually, it's in the catalog-info.yaml under metadata.

I followed all documentation I could find, but one section is not enough clear for me. It's about the annotations thing. It says `Add annotation to the yaml config file of a component. I created a component yesterday, but I don't see any file for it.

Thanks in advance.

Upvotes: 2

Views: 1001

Answers (2)

Saket Suraj
Saket Suraj

Reputation: 187

This is because you have not defined jira/project-key: <some-value> in the catalog-info.yaml file of the service that you are importing. This should go in the annotations key where you have defined your kind:component. Here is the official documentation that you can refer: https://roadie.io/backstage/plugins/jira/

For example:

Component Definition

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: repo-name
  title: Repo Name
  description: |
    Data Repo description.
  tags:
    - java
    - python
  annotations:
    jira/project-key: "example-key"

Upvotes: 0

Nico
Nico

Reputation: 115

Ok, I found the solution.

In the documentation, the file, called catalog-info.yaml, is not the one at the Backstage repository's root, but to a file in a different repository that will be used as component template in Backstage.

If you create a new repository (ex a fork from Symfony), you will have to add the file catalog-info.yaml with various informations if you want to use this repository as template for your projects.

Upvotes: 0

Related Questions