1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getProjectLabel
GitLab v9.9.0 published on Saturday, Feb 21, 2026 by Pulumi
gitlab logo
GitLab v9.9.0 published on Saturday, Feb 21, 2026 by Pulumi

    The gitlab.ProjectLabel data source retrieves details about a project label.

    Upstream API: GitLab REST API docs

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gitlab from "@pulumi/gitlab";
    
    // Retrieve a project label by its ID
    const example = gitlab.getProjectLabel({
        project: "385",
        labelId: 24,
    });
    // Retrieve using project path
    const byPath = gitlab.getProjectLabel({
        project: "group/project",
        labelId: 25,
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    # Retrieve a project label by its ID
    example = gitlab.get_project_label(project="385",
        label_id=24)
    # Retrieve using project path
    by_path = gitlab.get_project_label(project="group/project",
        label_id=25)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Retrieve a project label by its ID
    		_, err := gitlab.LookupProjectLabel(ctx, &gitlab.LookupProjectLabelArgs{
    			Project: "385",
    			LabelId: 24,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Retrieve using project path
    		_, err = gitlab.LookupProjectLabel(ctx, &gitlab.LookupProjectLabelArgs{
    			Project: "group/project",
    			LabelId: 25,
    		}, 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 project label by its ID
        var example = GitLab.GetProjectLabel.Invoke(new()
        {
            Project = "385",
            LabelId = 24,
        });
    
        // Retrieve using project path
        var byPath = GitLab.GetProjectLabel.Invoke(new()
        {
            Project = "group/project",
            LabelId = 25,
        });
    
    });
    
    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.GetProjectLabelArgs;
    import java.util.List;
    import java.util.ArrayList;
    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 project label by its ID
            final var example = GitlabFunctions.getProjectLabel(GetProjectLabelArgs.builder()
                .project("385")
                .labelId(24)
                .build());
    
            // Retrieve using project path
            final var byPath = GitlabFunctions.getProjectLabel(GetProjectLabelArgs.builder()
                .project("group/project")
                .labelId(25)
                .build());
    
        }
    }
    
    variables:
      # Retrieve a project label by its ID
      example:
        fn::invoke:
          function: gitlab:getProjectLabel
          arguments:
            project: '385'
            labelId: 24
      # Retrieve using project path
      byPath:
        fn::invoke:
          function: gitlab:getProjectLabel
          arguments:
            project: group/project
            labelId: 25
    

    Using getProjectLabel

    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 getProjectLabel(args: GetProjectLabelArgs, opts?: InvokeOptions): Promise<GetProjectLabelResult>
    function getProjectLabelOutput(args: GetProjectLabelOutputArgs, opts?: InvokeOptions): Output<GetProjectLabelResult>
    def get_project_label(label_id: Optional[int] = None,
                          project: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetProjectLabelResult
    def get_project_label_output(label_id: Optional[pulumi.Input[int]] = None,
                          project: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetProjectLabelResult]
    func LookupProjectLabel(ctx *Context, args *LookupProjectLabelArgs, opts ...InvokeOption) (*LookupProjectLabelResult, error)
    func LookupProjectLabelOutput(ctx *Context, args *LookupProjectLabelOutputArgs, opts ...InvokeOption) LookupProjectLabelResultOutput

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

    public static class GetProjectLabel 
    {
        public static Task<GetProjectLabelResult> InvokeAsync(GetProjectLabelArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectLabelResult> Invoke(GetProjectLabelInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectLabelResult> getProjectLabel(GetProjectLabelArgs args, InvokeOptions options)
    public static Output<GetProjectLabelResult> getProjectLabel(GetProjectLabelArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gitlab:index/getProjectLabel:getProjectLabel
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getProjectLabel 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.
    Id string
    The ID of the label in the format project:label_id.
    IsProjectLabel bool
    Whether the label is a project label.
    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.
    Priority int
    The priority of the label. Null if no priority is set.
    Project string
    The ID or URL-encoded path of the project.
    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.
    Id string
    The ID of the label in the format project:label_id.
    IsProjectLabel bool
    Whether the label is a project label.
    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.
    Priority int
    The priority of the label. Null if no priority is set.
    Project string
    The ID or URL-encoded path of the project.
    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 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.
    id String
    The ID of the label in the format project:label_id.
    isProjectLabel Boolean
    Whether the label is a project label.
    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.
    priority Integer
    The priority of the label. Null if no priority is set.
    project String
    The ID or URL-encoded path of the project.
    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.
    id string
    The ID of the label in the format project:label_id.
    isProjectLabel boolean
    Whether the label is a project label.
    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.
    priority number
    The priority of the label. Null if no priority is set.
    project string
    The ID or URL-encoded path of the project.
    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.
    id str
    The ID of the label in the format project:label_id.
    is_project_label bool
    Whether the label is a project label.
    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.
    priority int
    The priority of the label. Null if no priority is set.
    project str
    The ID or URL-encoded path of the project.
    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.
    id String
    The ID of the label in the format project:label_id.
    isProjectLabel Boolean
    Whether the label is a project label.
    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.
    priority Number
    The priority of the label. Null if no priority is set.
    project String
    The ID or URL-encoded path of the project.
    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
    GitLab v9.9.0 published on Saturday, Feb 21, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate