> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blocks.team/llms.txt
> Use this file to discover all available pages before exploring further.

# github.issue_comment

This event occurs when there is a comment on an issue. Github considers `issues` and `pull_requests` to both be issues, but we have separated these events for clarity.

```python theme={null}
@on("github.issue_comment")
def agent(input):
    pass
```

The following is an example payload which is passed in as an argument to your agent's entrypoint:

<CodeGroup>
  ```json json theme={null}
  {
    "$raw": {},
    "action": "created",
    "issue": {
      "author": "octocat",
      "body": "When trying to login with GitHub, the callback URL is not handling special characters correctly.",
      "comments": [
        {
          "author": "other-user",
          "body": "I can reproduce this issue. It happens when the username contains '@' symbol.",
          "created_at": "2024-03-21T14:35:00Z",
          "id": 987654321,
          "node_id": "MDEyOklzc3VlQ29tbWVudDk4NzY1NDMyMQ==",
          "url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/987654321"
        }
      ],
      "created_at": "2024-03-21T14:30:00Z",
      "id": 1234567890,
      "labels": [
        {
          "color": "d73a4a",
          "default": true,
          "description": "Something isn't working",
          "id": 123456,
          "name": "bug",
          "node_id": "MDU6TGFiZWwxMjM0NTY="
        },
        {
          "color": "b60205",
          "default": false,
          "description": "Needs immediate attention",
          "id": 789012,
          "name": "high-priority",
          "node_id": "MDU6TGFiZWw3ODkwMTI="
        }
      ],
      "node_id": "MDU6SXNzdWUxMjM0NTY3ODkw",
      "number": 42,
      "state": "open",
      "title": "Found a bug in the authentication flow",
      "url": "https://api.github.com/repos/octocat/Hello-World/issues/42"
    },
    "new_comment": {
      "author": "developer123",
      "body": "I've identified the root cause. The URL encoding is being applied twice in the callback handler. Will submit a fix shortly.",
      "created_at": "2024-03-21T15:00:00Z",
      "id": 987654322,
      "node_id": "MDEyOklzc3VlQ29tbWVudDk4NzY1NDMyMg==",
      "url": "https://api.github.com/repos/octocat/Hello-World/issues/comments/987654322"
    },
    "owner": "octocat",
    "repo": "Hello-World"
  }
  ```

  ```python agent.py theme={null}
  def agent(input):
      $raw = input.get("$raw")
      action = input.get("action")
      issue = input.get("issue")
      new_comment = input.get("new_comment")
      owner = input.get("owner")
      repo = input.get("repo")
  ```
</CodeGroup>

## Fields

<ResponseField name="$raw" type="object">
  The raw Github `issue_comment` event payload.
</ResponseField>

<ResponseField name="action" type="string">
  The action that occurred on the pull request.

  <Expandable title="action values">
    <ResponseField name="opened" type="string">
      The pull request was opened.
    </ResponseField>

    <ResponseField name="edited" type="string">
      The pull request was edited. For example, the title or description was changed.
    </ResponseField>

    <ResponseField name="synchronize" type="string">
      The pull request was synchronized. For example, when a new commit is pushed to the branch.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="issue" type="object">
  The issue that the comment is on.

  <Expandable title="issue properties">
    <ResponseField name="author" type="string">
      The author of the issue.
    </ResponseField>

    <ResponseField name="body" type="string">
      The body of the issue.
    </ResponseField>

    <ResponseField name="comments" type="object[]">
      The comments on the issue.

      <Expandable title="comment properties">
        <ResponseField name="author" type="string">
          The author of the comment.
        </ResponseField>

        <ResponseField name="body" type="string">
          The body of the comment.
        </ResponseField>

        <ResponseField name="created_at" type="string">
          The date and time the comment was created.
        </ResponseField>

        <ResponseField name="id" type="number">
          The ID of the comment.
        </ResponseField>

        <ResponseField name="node_id" type="string">
          The node ID of the comment.
        </ResponseField>

        <ResponseField name="url" type="string">
          The URL of the comment.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="created_at" type="string">
      The date and time the issue was created.
    </ResponseField>

    <ResponseField name="id" type="number">
      The ID of the issue.
    </ResponseField>

    <ResponseField name="labels" type="object[]">
      The labels on the issue.

      <Expandable title="label properties">
        <ResponseField name="color" type="string">
          The color of the label.
        </ResponseField>

        <ResponseField name="default" type="boolean">
          Whether the label is the default label.
        </ResponseField>

        <ResponseField name="description" type="string">
          The description of the label.
        </ResponseField>

        <ResponseField name="id" type="number">
          The ID of the label.
        </ResponseField>

        <ResponseField name="name" type="string">
          The name of the label.
        </ResponseField>

        <ResponseField name="node_id" type="string">
          The node ID of the label.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="node_id" type="string">
      The node ID of the issue.
    </ResponseField>

    <ResponseField name="number" type="number">
      The number of the issue.
    </ResponseField>

    <ResponseField name="state" type="string">
      The state of the issue.
    </ResponseField>

    <ResponseField name="title" type="string">
      The title of the issue.
    </ResponseField>

    <ResponseField name="url" type="string">
      The URL of the issue.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="new_comment" type="object">
  The new comment that was added.

  <Expandable title="new_comment properties">
    <ResponseField name="author" type="string">
      The author of the new comment.
    </ResponseField>

    <ResponseField name="body" type="string">
      The body of the new comment.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      The date and time the new comment was created.
    </ResponseField>

    <ResponseField name="id" type="number">
      The ID of the new comment.
    </ResponseField>

    <ResponseField name="node_id" type="string">
      The node ID of the new comment.
    </ResponseField>

    <ResponseField name="url" type="string">
      The URL of the new comment.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="owner" type="string">
  The owner of the repository.
</ResponseField>

<ResponseField name="repo" type="string">
  The name of the repository.
</ResponseField>
