Skip to content

Add create issue command to CLI #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add create issue command to CLI #9

wants to merge 1 commit into from

Conversation

kaar
Copy link
Owner

@kaar kaar commented Sep 23, 2024

Add a new command create to the cmd_issue CLI group. This command
allows users to create issues with various options such as title,
description, team ID, label IDs, and assignee ID. The command also
supports output in JSON format.

Example usage:

linear issue create "New Issue" --description "Details" --team-id "team123"

In client.py, add a create_issue method to the User class to
handle the GraphQL mutation for creating issues. This method constructs
the mutation query and prints it for debugging purposes.

Example:

user.create_issue(
    title="New Issue",
    description="Details",
    team_id="team123",
    label_id=["label1", "label2"],
    assignee_id="assignee123"
)
  • The create_issue method currently returns an empty list and does not
    execute the GraphQL request. The line # data = gql_request(query)
    should be uncommented and properly implemented.
  • The return Issue.from_dict(data["data"]["createIssue"]["issue"])
    line is unreachable due to the preceding return [] statement. The
    first return statement should be removed.

Add a new command `create` to the `cmd_issue` CLI group. This command
allows users to create issues with various options such as title,
description, team ID, label IDs, and assignee ID. The command also
supports output in JSON format.

Example usage:
```sh
linear issue create "New Issue" --description "Details" --team-id "team123"
```

In `client.py`, add a `create_issue` method to the `User` class to
handle the GraphQL mutation for creating issues. This method constructs
the mutation query and prints it for debugging purposes.

Example:
```python
user.create_issue(
    title="New Issue",
    description="Details",
    team_id="team123",
    label_id=["label1", "label2"],
    assignee_id="assignee123"
)
```

- The `create_issue` method currently returns an empty list and does not
  execute the GraphQL request. The line `# data = gql_request(query)`
  should be uncommented and properly implemented.
- The `return Issue.from_dict(data["data"]["createIssue"]["issue"])`
  line is unreachable due to the preceding `return []` statement. The
  first return statement should be removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant