Skip to content

gitlab create-issue

Create gitlab issue

Description

Create gitlab issue

Synopsis

gitlab create-issue
    [--site <site>]
    --title <title>
    --assignee <assignee>
    [--confidential]
    [--created_at <created_at>]
    [--description <description>]
    [--discussion_to_resolve <discussion_to_resolve>]
    [--due_date <due_date>]
    [--epic_id <epic_id>]
    --project <project>
    [--issue <issue>]
    [--issue_type <issue_type>]
    [--labels <labels>]
    [--weight <weight>]

Arguments

site - (string)

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

title - (string)

     Title of an issue
     Example: --title "issue1"
     Default: _None_      Attributes: required

assignee - (string)

     The ID of the user to assign the issue to. Only appears on GitLab Free.
     Example: --assignee "1"
     Default: _None_      Attributes: required

confidential - (bool)

     Set an issue to be confidential. Default is false.
     Example: --confidential
     Default: _None_      Attributes: optional

created_at - (time)

     When the issue was created. Requires administrator or project/group owner rights.
     Example: --created_at "1 day ago"
     Default: _None_      Attributes: optional

description - (string)

     The description of an issue. Limited to 1,048,576 characters.
     Example: --description "issue1"
     Default: _None_      Attributes: optional

discussion_to_resolve - (string)

     The ID of a discussion to resolve. This fills out the issue with a default description and mark the discussion as resolved. Use in combination with merge_request_to_resolve_discussions_of.
     Example: --discussion_to_resolve "1"
     Default: _None_      Attributes: optional

due_date - (string)

     The due date. Date time string in the format YYYY-MM-DD
     Example: --due_date "2016-03-11"
     Default: _None_      Attributes: optional

epic_id - (int)

     ID of the epic to add the issue to. Valid values are greater than or equal to 0.
     Example: --epic_id 1
     Default: _None_      Attributes: optional

project - (string)

     The path of the project owned by the authenticated user .
     Example: --project "saiprakash_maira/testing"
     Default: _None_      Attributes: required

issue - (int)

     The internal ID of the project’s issue (requires administrator or project owner rights)
     Example: --issue 1
     Default: _None_      Attributes: optional

issue_type - (string)

     The type of issue. One of issue, incident, or test_case. Default is issue.
     Example: --issue_type "issue"
     Default: _None_      Attributes: optional

labels - (string)

     Label names for an issue
     Example: --labels "label"
     Default: _None_      Attributes: optional, multiple allowed

weight - (int)

     The weight of the issue. Valid values are greater than or equal to 0.
     Example: --weight 10
     Default: _None_      Attributes: optional

Examples

Input:

! gitlab create-issue --project "saiprakash_maira/testing" --title "new_issue" --assignee saiprakash_maira --description "testing" --due_date "2021-12-12"
Output:
{
  "id": 97339123,
  "iid": 3,
  "project_id": 31319463,
  "title": "new_issue",
  "description": "testing",
  "state": "opened",
  "created_at": "2021-11-15T10:47:47.366Z",
  "updated_at": "2021-11-15T10:47:47.366Z",
  "closed_at": null,
  "closed_by": null,
  "labels": [],
  "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": 0,
  "merge_requests_count": 0,
  "upvotes": 0,
  "downvotes": 0,
  "due_date": "2021-12-12",
  "confidential": false,
  "discussion_locked": null,
  "issue_type": "issue",
  "web_url": "https://gitlab.com/saiprakash_maira/testing/-/issues/3",
  "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": null,
  "blocking_issues_count": 0,
  "has_tasks": false,
  "_links": {
    "self": "https://gitlab.com/api/v4/projects/31319463/issues/3",
    "notes": "https://gitlab.com/api/v4/projects/31319463/issues/3/notes",
    "award_emoji": "https://gitlab.com/api/v4/projects/31319463/issues/3/award_emoji",
    "project": "https://gitlab.com/api/v4/projects/31319463"
  },
  "references": {
    "short": "#3",
    "relative": "#3",
    "full": "saiprakash_maira/testing#3"
  },
  "subscribed": true,
  "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 "create"
Service Type "gitlab"
Service Instance
Namespace project
Object Type "issue"
Object ID

Please see Access Control for details.