Skip to content

Added possibility to search CRM contacts and organizations by ids

What does this MR do and why?

This MR is a follow up of !88752 (merged) and introduces the possibility to filter CRM contacts and organizations also by IDs, as I noticed we have that need.

Screenshots or screen recordings

Contacts by IDs Organizations by IDs
image image

How to set up and validate locally

  1. Enable the CRM feature on a root group (e.g.: Gitlab Org in GDK)
  2. Contacts and organizations should already be seeded, otherwise add some organizations and contacts
  3. Run this example GraphQL query to filter the contacts
fragment ContactFragment on CustomerRelationsContact {
  __typename
  id
  firstName
  lastName
  email
}


query {
  group(fullPath: "gitlab-org") {
    id
    #contacts {
    contacts(ids: [
      "gid://gitlab/CustomerRelations::Contact/9",
      "gid://gitlab/CustomerRelations::Contact/13"]
    ) {
      nodes {
        ...ContactFragment
      }
    }
  }
}
  1. Run this example GraphQL query to filter the organizations
fragment OrganizationFragment on CustomerRelationsOrganization {
  __typename
  id
  name
}

query {
  group(fullPath: "gitlab-org") {
    id
    # organizations {
    organizations(ids: [
      "gid://gitlab/CustomerRelations::Organization/5",
      "gid://gitlab/CustomerRelations::Organization/8"
    ]) {
      nodes {
        ...OrganizationFragment
      }
    }
  }
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports