Skip to content

Allow extracting labels in GLQL

Himanshu Kapoor requested to merge 480696-glql-extract-labels into master

What does this MR do and why?

Allow extracting labels in GLQL

Use a separate label parser function to extract one or more labels in a GLQL rendered table or list. Also add support for field aliases: #480712 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

image

How to set up and validate locally

  1. Go to Manage > Labels in your project's sidebar and add some workflow labels similar to how they are set up in the GitLab project.
  2. Assign yourself some issues in the project and also randomly set some labels, including workflow labels on those issues.
  3. Use the below GLQL query in a new wiki page:
```glql
---
display: table 
fields: title, assignees, labels("workflow"), labels, health
---
assignee = currentUser()
```
  1. The above query should extract all workflow labels in the Label: Workflow column, and they should not show up the Labels column anymore.

In addition to the labels function, this MR also introduces some field aliases to solve #480712 (closed). See file app/assets/javascripts/glql/core/transformer/field_aliases.js for a list of aliases.

Related to #480696 (closed)

Edited by Himanshu Kapoor

Merge request reports

Loading