1. Packages
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. getGroupLabel
Viewing docs for GitLab v10.0.0
published on Friday, Jun 26, 2026 by Pulumi
gitlab logo
Viewing docs for GitLab v10.0.0
published on Friday, Jun 26, 2026 by Pulumi

    The gitlab.GroupLabel data source retrieves details about a group label.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    // Retrieve a group label by its ID
    const example = gitlab.getGroupLabel({
        group: "my-group",
        labelId: 42,
    });
    // Retrieve using group ID
    const byId = gitlab.getGroupLabel({
        group: "385",
        labelId: 24,
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    # Retrieve a group label by its ID
    example = gitlab.get_group_label(group="my-group",
        label_id=42)
    # Retrieve using group ID
    by_id = gitlab.get_group_label(group="385",
        label_id=24)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Retrieve a group label by its ID
    		_, err := gitlab.GetGroupLabel(ctx, &gitlab.LookupGroupLabelArgs{
    			Group:   "my-group",
    			LabelId: 42,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Retrieve using group ID
    		_, err = gitlab.GetGroupLabel(ctx, &gitlab.LookupGroupLabelArgs{
    			Group:   "385",
    			LabelId: 24,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        // Retrieve a group label by its ID
        var example = GitLab.GetGroupLabel.Invoke(new()
        {
            Group = "my-group",
            LabelId = 42,
        });
    
        // Retrieve using group ID
        var byId = GitLab.GetGroupLabel.Invoke(new()
        {
            Group = "385",
            LabelId = 24,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gitlab.GitlabFunctions;
    import com.pulumi.gitlab.inputs.GetGroupLabelArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // Retrieve a group label by its ID
            final var example = GitlabFunctions.getGroupLabel(GetGroupLabelArgs.builder()
                .group("my-group")
                .labelId(42)
                .build());
    
            // Retrieve using group ID
            final var byId = GitlabFunctions.getGroupLabel(GetGroupLabelArgs.builder()
                .group("385")
                .labelId(24)
                .build());
    
        }
    }
    
    variables:
      # Retrieve a group label by its ID
      example:
        fn::invoke:
          function: gitlab:getGroupLabel
          arguments:
            group: my-group
            labelId: 42
      # Retrieve using group ID
      byId:
        fn::invoke:
          function: gitlab:getGroupLabel
          arguments:
            group: '385'
            labelId: 24
    
    pulumi {
      required_providers {
        gitlab = {
          source = "pulumi/gitlab"
        }
      }
    }
    
    data "gitlab_getgrouplabel" "example" {
      group    = "my-group"
      label_id = 42
    }
    data "gitlab_getgrouplabel" "byId" {
      group    = "385"
      label_id = 24
    }
    
    # Retrieve a group label by its ID
    # Retrieve using group ID
    

    Using getGroupLabel

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getGroupLabel(args: GetGroupLabelArgs, opts?: InvokeOptions): Promise<GetGroupLabelResult>
    function getGroupLabelOutput(args: GetGroupLabelOutputArgs, opts?: InvokeOptions): Output<GetGroupLabelResult>
    def get_group_label(group: Optional[str] = None,
                        label_id: Optional[int] = None,
                        opts: Optional[InvokeOptions] = None) -> GetGroupLabelResult
    def get_group_label_output(group: pulumi.Input[Optional[str]] = None,
                        label_id: pulumi.Input[Optional[int]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetGroupLabelResult]
    func LookupGroupLabel(ctx *Context, args *LookupGroupLabelArgs, opts ...InvokeOption) (*LookupGroupLabelResult, error)
    func LookupGroupLabelOutput(ctx *Context, args *LookupGroupLabelOutputArgs, opts ...InvokeOption) LookupGroupLabelResultOutput

    > Note: This function is named LookupGroupLabel in the Go SDK.

    public static class GetGroupLabel 
    {
        public static Task<GetGroupLabelResult> InvokeAsync(GetGroupLabelArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupLabelResult> Invoke(GetGroupLabelInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupLabelResult> getGroupLabel(GetGroupLabelArgs args, InvokeOptions options)
    public static Output<GetGroupLabelResult> getGroupLabel(GetGroupLabelArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gitlab:index/getGroupLabel:getGroupLabel
      arguments:
        # arguments dictionary
    data "gitlab_getgrouplabel" "name" {
        # arguments
    }

    The following arguments are supported:

    Group string
    The ID or URL-encoded path of the group.
    LabelId int
    The ID of the label.
    Group string
    The ID or URL-encoded path of the group.
    LabelId int
    The ID of the label.
    group string
    The ID or URL-encoded path of the group.
    label_id number
    The ID of the label.
    group String
    The ID or URL-encoded path of the group.
    labelId Integer
    The ID of the label.
    group string
    The ID or URL-encoded path of the group.
    labelId number
    The ID of the label.
    group str
    The ID or URL-encoded path of the group.
    label_id int
    The ID of the label.
    group String
    The ID or URL-encoded path of the group.
    labelId Number
    The ID of the label.

    getGroupLabel Result

    The following output properties are available:

    ClosedIssuesCount int
    The number of closed issues with this label.
    Color string
    The color of the label given in 6-digit hex notation with leading '#' sign.
    Description string
    The description of the label.
    Group string
    The ID or URL-encoded path of the group.
    Id string
    The ID of the label in the format group:label_id.
    LabelId int
    The ID of the label.
    Name string
    The name of the label.
    OpenIssuesCount int
    The number of open issues with this label.
    OpenMergeRequestsCount int
    The number of open merge requests with this label.
    Subscribed bool
    Whether the authenticated user is subscribed to the label.
    TextColor string
    The text color of the label given in 6-digit hex notation with leading '#' sign.
    ClosedIssuesCount int
    The number of closed issues with this label.
    Color string
    The color of the label given in 6-digit hex notation with leading '#' sign.
    Description string
    The description of the label.
    Group string
    The ID or URL-encoded path of the group.
    Id string
    The ID of the label in the format group:label_id.
    LabelId int
    The ID of the label.
    Name string
    The name of the label.
    OpenIssuesCount int
    The number of open issues with this label.
    OpenMergeRequestsCount int
    The number of open merge requests with this label.
    Subscribed bool
    Whether the authenticated user is subscribed to the label.
    TextColor string
    The text color of the label given in 6-digit hex notation with leading '#' sign.
    closed_issues_count number
    The number of closed issues with this label.
    color string
    The color of the label given in 6-digit hex notation with leading '#' sign.
    description string
    The description of the label.
    group string
    The ID or URL-encoded path of the group.
    id string
    The ID of the label in the format group:label_id.
    label_id number
    The ID of the label.
    name string
    The name of the label.
    open_issues_count number
    The number of open issues with this label.
    open_merge_requests_count number
    The number of open merge requests with this label.
    subscribed bool
    Whether the authenticated user is subscribed to the label.
    text_color string
    The text color of the label given in 6-digit hex notation with leading '#' sign.
    closedIssuesCount Integer
    The number of closed issues with this label.
    color String
    The color of the label given in 6-digit hex notation with leading '#' sign.
    description String
    The description of the label.
    group String
    The ID or URL-encoded path of the group.
    id String
    The ID of the label in the format group:label_id.
    labelId Integer
    The ID of the label.
    name String
    The name of the label.
    openIssuesCount Integer
    The number of open issues with this label.
    openMergeRequestsCount Integer
    The number of open merge requests with this label.
    subscribed Boolean
    Whether the authenticated user is subscribed to the label.
    textColor String
    The text color of the label given in 6-digit hex notation with leading '#' sign.
    closedIssuesCount number
    The number of closed issues with this label.
    color string
    The color of the label given in 6-digit hex notation with leading '#' sign.
    description string
    The description of the label.
    group string
    The ID or URL-encoded path of the group.
    id string
    The ID of the label in the format group:label_id.
    labelId number
    The ID of the label.
    name string
    The name of the label.
    openIssuesCount number
    The number of open issues with this label.
    openMergeRequestsCount number
    The number of open merge requests with this label.
    subscribed boolean
    Whether the authenticated user is subscribed to the label.
    textColor string
    The text color of the label given in 6-digit hex notation with leading '#' sign.
    closed_issues_count int
    The number of closed issues with this label.
    color str
    The color of the label given in 6-digit hex notation with leading '#' sign.
    description str
    The description of the label.
    group str
    The ID or URL-encoded path of the group.
    id str
    The ID of the label in the format group:label_id.
    label_id int
    The ID of the label.
    name str
    The name of the label.
    open_issues_count int
    The number of open issues with this label.
    open_merge_requests_count int
    The number of open merge requests with this label.
    subscribed bool
    Whether the authenticated user is subscribed to the label.
    text_color str
    The text color of the label given in 6-digit hex notation with leading '#' sign.
    closedIssuesCount Number
    The number of closed issues with this label.
    color String
    The color of the label given in 6-digit hex notation with leading '#' sign.
    description String
    The description of the label.
    group String
    The ID or URL-encoded path of the group.
    id String
    The ID of the label in the format group:label_id.
    labelId Number
    The ID of the label.
    name String
    The name of the label.
    openIssuesCount Number
    The number of open issues with this label.
    openMergeRequestsCount Number
    The number of open merge requests with this label.
    subscribed Boolean
    Whether the authenticated user is subscribed to the label.
    textColor String
    The text color of the label given in 6-digit hex notation with leading '#' sign.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    Viewing docs for GitLab v10.0.0
    published on Friday, Jun 26, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial