Uploaded image for project: 'Konflux UI'
  1. Konflux UI
  2. KFLUXUI-677

Kite: Links related to Issues are not returned in API

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Konflux
    • 3

      When creating an issue with links, the links association is not preloaded like the other associations, so they get returned null:

       

      {
       "id": "a501c4e0-b10c-4fa1-91e0-50aaf7ed9fdd",
       "title": "Test PR",
       "description": "Testing this API before submitting PR",
       "severity": "critical",
       "issueType": "test",
       "state": "ACTIVE",
       "detectedAt": "2025-08-07T18:01:41.491844Z",
       "resolvedAt": null,
       "namespace": "default",
       "scopeId": "4dda70ee-be0f-4fd0-b9c9-c8ce76fc6d76",
       "scope": {
       "id": "4dda70ee-be0f-4fd0-b9c9-c8ce76fc6d76",
       "resourceType": "component",
       "resourceName": "pull-request",
       "resourceNamespace": "default"
       },
       "links": null,
       "relatedFrom": [],
       "relatedTo": [],
       "createdAt": "2025-08-07T18:01:41.492752Z",
       "updatedAt": "2025-08-07T18:01:41.492752Z"
      }

      To test, you can send this payload when creating an issue:

      {
        "title": "Test PR",
        "description": "Testing this API before submitting PR",
        "severity": "critical",
        "issueType": "test",
        "state": "ACTIVE",
        "namespace": "default",
        "scope": {
          "resourceType": "component",
          "resourceName": "pull-request"
        },
        "links": [
          {
            "title": "Pull Request",
            "url": "https://github.com/konflux-ci/kite/pull/101"
          }
        ]
      } 

      The solution is to preload the links association in the "FindByID" method:

      https://github.com/konflux-ci/kite/blob/main/packages/backend/internal/repository/issue_repository.go#L138-L144

       

       

              rh-ee-jpolonip Joao Pedro Poloni Ponce
              bramos@redhat.com Bryan Ramos
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: