Skip to content

gitlab list-issues

List gitlab issue

Description

List gitlab issue

Synopsis

gitlab list-issues
    [--site <site>]
    --project <project>
    [--assignee <assignee>]
    [--author <author>]
    [--confidential]
    [--created_after <created_after>]
    [--created_before <created_before>]
    [--due_date <due_date>]
    [--issues <issues>]
    [--issue_type <issue_type>]
    [--iteration_title <iteration_title>]
    [--labels <labels>]
    [--non_archived]
    [--order_by <order_by>]
    [--scope <scope>]
    [--search <search>]
    [--sort <sort>]
    [--state <state>]
    [--updated_after <updated_after>]
    [--updated_before <updated_before>]
    [--weight <weight>]
    [--with_labels_details]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

project - (string)

     The path of the project
     Example: --project "saiprakash_maira/testing"
     Default: _None_      Attributes: required

assignee - (string)

     Return issues assigned to the given username. Similar to assignee_id and mutually exclusive with assignee_id. In GitLab CE, the assignee_username array should only contain a single value. Otherwise, an invalid parameter error is returned.
     Example: --assignee "myname"
     Default: _None_      Attributes: optional, multiple allowed

author - (string)

     Return issues created by the given username. Similar to author_id and mutually exclusive with author_id.
     Example: --author "author_name"
     Default: _None_      Attributes: optional

confidential - (bool)

     Filter confidential or public issues.
     Example: --confidential
     Default: _None_      Attributes: optional

created_after - (time)

     Return issues created on or after the given time
     Example: --created_after "1 day ago"
     Default: _None_      Attributes: optional

created_before - (time)

     Return issues created on or before the given time
     Example: --created_before "now"
     Default: _None_      Attributes: optional

due_date - (string)

     Return issues that have no due date, are overdue, or whose due date is this week, this month, or between two weeks ago and next month. Accepts 0 (no due date), overdue, week, month, next_month_and_previous_two_weeks.
     Example: --due_date "overdue"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: 0, overdue, week, month, next_month_and_previous_two_weeks

issues - (int)

     Return only the issues having the given iid
     Example: --issues 1
     Default: _None_      Attributes: optional, multiple allowed

issue_type - (string)

     Filter to a given type of issue. One of issue, incident, or test_case.
     Example: --issue_type "test_case"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: issue, incident, test_case

iteration_title - (string)

     Return issues assigned to the iteration with the given title. Similar to iteration_id and mutually exclusive with iteration_id.
     Example: --iteration_title "title"
     Default: _None_      Attributes: optional

labels - (string)

     Label names, issues must have all labels to be returned. None lists all issues with no labels. Any lists all issues with at least one label. Predefined names are case-insensitive.
     Example: --labels "label"
     Default: _None_      Attributes: optional, multiple allowed

non_archived - (bool)

     Return issues only from non-archived projects. If false, the response returns issues from both archived and non-archived projects. Default is true.
     Example: --non_archived
     Default: _None_      Attributes: optional

order_by - (string)

     Return issues ordered by created_at, due_date, label_priority, milestone_due, popularity, priority, relative_position, title, updated_at, or weight fields. Default is created_at.
     Example: --order_by "created_at"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: created_at, due_date, label_priority, milestone_due, popularity, priority, relative_position, title, updated_at, weight

scope - (string)

     Return issues for the given scope - created_by_me, assigned_to_me or all. Defaults to created_by_me
     Example: --scope "created_by_me"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: created_by_me, assigned_to_me, all

search - (string)

     Search issues against their title and description
     Example: --search "title"
     Default: _None_      Attributes: optional

sort - (string)

     Return issues sorted in asc or desc order. Default is desc
     Example: --sort "asc"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: asc, desc

state - (string)

     Return all issues or just those that are opened or closed
     Example: --state "opened"
     Default: _None_      Attributes: optional

     Validation:
         allowed values: opened, closed

updated_after - (time)

     Return issues updated on or after the given time.
     Example: --updated_after "1 day ago"
     Default: _None_      Attributes: optional

updated_before - (time)

     Return issues updated on or before the given time.
     Example: --updated_before "1 day ago"
     Default: _None_      Attributes: optional

weight - (int)

     Return issues with the specified weight. None returns issues with no weight assigned. Any returns issues with a weight assigned.
     Example: --weight 10
     Default: _None_      Attributes: optional

with_labels_details - (bool)

     If true, the response returns more details for each label in labels field: :name, :color, :description, :description_html, :text_color. Default is false.
     Example: --with_labels_details
     Default: _None_      Attributes: optional

Examples

Input:

!gitlab list-issues --project "gitlab-com/sales-team/field-operations/sales-operations"
Output:
NUMBER  LABELS                          STATE   ASSIGNEES       MILESTONE                           TITLE
3031    SalesOPS                        opened  Astahn          SalesOp: 06/06/2022 - 06/19/2022    Win Rate and New Logo Reports for Win / Loss OKR
3029    SalesOps::New_Request           opened  lcartagena1     SalesOp: 06/06/2022 - 06/19/2022    DualBoot - How to Handle Partner Registrations & Churn for existing Named Customer
3028    FieldOps                        opened  carolynharding  SalesOp: 06/06/2022 - 06/19/2022    Rachel Richburg, Senior Strategic Account Leader, New Hire Territory, ENT_LRG_AMER_EAST_SCEN_06
3026    LeanData                        closed  Astahn          SalesOp: 06/06/2022 - 06/19/2022    Steve Xu Territory Change
Input:
x = ! gitlab list-issues --labels "new_label"
Output:
[
  {
    "id": 97399269,
    "iid": 4,
    "project_id": 31319463,
    "title": "issue3",
    "description": "hello new edit",
    "state": "opened",
    "created_at": "2016-03-11T03:45:40.000Z",
    "updated_at": "2021-11-16T12:52:11.470Z",
    "closed_at": null,
    "closed_by": null,
    "labels": ["new_label"],
    "milestone": null,
    "assignees": [
      {
        "id": 10215385,
        "name": "Sai Prakash V",
        "username": "saiprakash_maira",
        "state": "active",
        "avatar_url": "https://secure.gravatar.com/avatar/21de8fa15da66206e835a51bf9b68c32?s=80\u0026d=identicon",
        "web_url": "https://gitlab.com/saiprakash_maira"
      }
    ],
    "author": {
      "id": 10215385,
      "name": "Sai Prakash V",
      "username": "saiprakash_maira",
      "state": "active",
      "avatar_url": "https://secure.gravatar.com/avatar/21de8fa15da66206e835a51bf9b68c32?s=80\u0026d=identicon",
      "web_url": "https://gitlab.com/saiprakash_maira"
    },
    "type": "ISSUE",
    "assignee": {
      "id": 10215385,
      "name": "Sai Prakash V",
      "username": "saiprakash_maira",
      "state": "active",
      "avatar_url": "https://secure.gravatar.com/avatar/21de8fa15da66206e835a51bf9b68c32?s=80\u0026d=identicon",
      "web_url": "https://gitlab.com/saiprakash_maira"
    },
    "user_notes_count": 3,
    "merge_requests_count": 0,
    "upvotes": 0,
    "downvotes": 0,
    "due_date": "2021-12-12",
    "confidential": false,
    "discussion_locked": false,
    "issue_type": "issue",
    "web_url": "https://gitlab.com/saiprakash_maira/testing/-/issues/4",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    },
    "task_completion_status": {
      "count": 0,
      "completed_count": 0
    },
    "weight": 10,
    "blocking_issues_count": 0,
    "has_tasks": false,
    "_links": {
      "self": "https://gitlab.com/api/v4/projects/31319463/issues/4",
      "notes": "https://gitlab.com/api/v4/projects/31319463/issues/4/notes",
      "award_emoji": "https://gitlab.com/api/v4/projects/31319463/issues/4/award_emoji",
      "project": "https://gitlab.com/api/v4/projects/31319463"
    },
    "references": {
      "short": "#4",
      "relative": "#4",
      "full": "saiprakash_maira/testing#4"
    },
    "moved_to_id": null,
    "service_desk_reply_to": null,
    "health_status": null
  }
]

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "gitlab"
Service Instance
Namespace project
Object Type "issue"
Object ID

Please see Access Control for details.