Skip to content

Add a GraphQL wrapper for Jira projects REST API

Alexandru Croitor requested to merge jira-projects-api-wrapper into master

What does this MR do?

Adds a GraphQL wrapper over jira projects api to allow us to pull jira projects from FE by running a GraphQL query.

Because we are using jira integration, i.e jira service to connect to jira instance, we are also using the service to return jira projects.

This MR is dependent on exposing project services MR which can be seen here for context: !28234 (merged)

A project can have multiple services enabled, so to pull jira service specifically we can run a query like:

query {
  project(fullPath: "gitlab-org/acroitor-test-group/acroitor-test-subgroup1/jira-import-test2") {
    services(active: true, type: JIRA_SERVICE) {
      edges {
        node {
          ... on JiraService {
            projects(name: "AL") {
              pageInfo {
                hasNextPage
              }
              edges{
                node{
                  key
                  name
                }
              }
            }
          }
        }
      }
    }
  }
}

And result is:

{
  "data": {
    "project": {
      "services": {
        "edges": [
          {
            "node": {
              "projects": {
                "pageInfo": {
                  "hasNextPage": false
                },
                "edges": [
                  {
                    "node": {
                      "key": "AL",
                      "name": "Alex"
                    }
                  },
                  {
                    "node": {
                      "key": "DON",
                      "name": "Donald"
                    }
                  }
                ]
              }
            }
          }
        ]
      }
    }
  }
}

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Jarka Košanová

Merge request reports