Skip to main content
The Jira plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see Overview for setup context and the exact URL shape).
New to Corsair? See webhooks and hooks.

Webhook map

  • issues
    • newIssue (issues.newIssue)
    • updatedIssue (issues.updatedIssue)
  • projects
    • newProject (projects.newProject)

HTTP handler setup

app/api/webhook/route.ts
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();
    const result = await processWebhook(corsair, headers, body);
    return result.response;
}

Events

Issues

New Issue

issues.newIssue Triggered when a new issue is created in Jira Payload
NameTypeRequiredDescription
webhookEventjira:issue_createdYes
timestampnumberNo
issueobjectNo
userobjectNo
{
  id?: string,
  key?: string,
  self?: string,
  fields?: {
    summary?: string,
    status?: {
      id?: string,
      name?: string,
      statusCategory?: {
        key?: string,
        name?: string
      }
    },
    assignee?: {
      accountId?: string,
      displayName?: string,
      emailAddress?: string
    } | null,
    reporter?: {
      accountId?: string,
      displayName?: string,
      emailAddress?: string
    },
    priority?: {
      id?: string,
      name?: string
    } | null,
    issuetype?: {
      id?: string,
      name?: string,
      subtask?: boolean
    },
    project?: {
      id?: string,
      key?: string,
      name?: string
    },
    labels?: string[],
    created?: string,
    updated?: string
  }
}
{
  accountId?: string,
  displayName?: string,
  emailAddress?: string
}
{
  webhookEvent: jira:issue_created,
  timestamp?: number,
  issue?: {
    id?: string,
    key?: string,
    self?: string,
    fields?: {
      summary?: string,
      status?: {
        id?: string,
        name?: string,
        statusCategory?: {
          key?: string,
          name?: string
        }
      },
      assignee?: {
        accountId?: string,
        displayName?: string,
        emailAddress?: string
      } | null,
      reporter?: {
        accountId?: string,
        displayName?: string,
        emailAddress?: string
      },
      priority?: {
        id?: string,
        name?: string
      } | null,
      issuetype?: {
        id?: string,
        name?: string,
        subtask?: boolean
      },
      project?: {
        id?: string,
        key?: string,
        name?: string
      },
      labels?: string[],
      created?: string,
      updated?: string
    }
  },
  user?: {
    accountId?: string,
    displayName?: string,
    emailAddress?: string
  }
}
webhookHooks example
jira({
    webhookHooks: {
        issues: {
            newIssue: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})

Updated Issue

issues.updatedIssue Triggered when an issue is updated in Jira Payload
NameTypeRequiredDescription
webhookEventjira:issue_updatedYes
timestampnumberNo
issueobjectNo
userobjectNo
changelogobjectNo
{
  id?: string,
  key?: string,
  self?: string,
  fields?: {
    summary?: string,
    status?: {
      id?: string,
      name?: string,
      statusCategory?: {
        key?: string,
        name?: string
      }
    },
    assignee?: {
      accountId?: string,
      displayName?: string,
      emailAddress?: string
    } | null,
    reporter?: {
      accountId?: string,
      displayName?: string,
      emailAddress?: string
    },
    priority?: {
      id?: string,
      name?: string
    } | null,
    issuetype?: {
      id?: string,
      name?: string,
      subtask?: boolean
    },
    project?: {
      id?: string,
      key?: string,
      name?: string
    },
    labels?: string[],
    updated?: string
  }
}
{
  accountId?: string,
  displayName?: string,
  emailAddress?: string
}
{
  id?: string,
  items?: {
    field?: string,
    fieldtype?: string,
    from?: string | null,
    fromString?: string | null,
    to?: string | null,
    toString?: string | null
  }[]
}
{
  webhookEvent: jira:issue_updated,
  timestamp?: number,
  issue?: {
    id?: string,
    key?: string,
    self?: string,
    fields?: {
      summary?: string,
      status?: {
        id?: string,
        name?: string,
        statusCategory?: {
          key?: string,
          name?: string
        }
      },
      assignee?: {
        accountId?: string,
        displayName?: string,
        emailAddress?: string
      } | null,
      reporter?: {
        accountId?: string,
        displayName?: string,
        emailAddress?: string
      },
      priority?: {
        id?: string,
        name?: string
      } | null,
      issuetype?: {
        id?: string,
        name?: string,
        subtask?: boolean
      },
      project?: {
        id?: string,
        key?: string,
        name?: string
      },
      labels?: string[],
      updated?: string
    }
  },
  user?: {
    accountId?: string,
    displayName?: string,
    emailAddress?: string
  },
  changelog?: {
    id?: string,
    items?: {
      field?: string,
      fieldtype?: string,
      from?: string | null,
      fromString?: string | null,
      to?: string | null,
      toString?: string | null
    }[]
  }
}
webhookHooks example
jira({
    webhookHooks: {
        issues: {
            updatedIssue: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})

Projects

New Project

projects.newProject Triggered when a new project is created in Jira Payload
NameTypeRequiredDescription
webhookEventproject_createdYes
timestampnumberNo
projectobjectNo
{
  id?: string,
  key?: string,
  name?: string,
  description?: string,
  projectTypeKey?: string,
  lead?: {
    accountId?: string,
    displayName?: string,
    emailAddress?: string
  },
  self?: string
}
{
  webhookEvent: project_created,
  timestamp?: number,
  project?: {
    id?: string,
    key?: string,
    name?: string,
    description?: string,
    projectTypeKey?: string,
    lead?: {
      accountId?: string,
      displayName?: string,
      emailAddress?: string
    },
    self?: string
  }
}
webhookHooks example
jira({
    webhookHooks: {
        projects: {
            newProject: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})