//native
/**
* Create or update an external issue
* Create or update an external issue from an integration platform integration.
*/
export async function main(auth: RT.Sentry, uuid: string, body: Body) {
const url = new URL(
`https://${auth.region}.sentry.io/api/0/sentry-app-installations/${uuid}/external-issues/`
)
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.token
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface Body {
/**
* The ID of the Sentry issue to link the external issue to.
*/
issueId: number
/**
* The URL of the external service to link the issue to.
*/
webUrl: string
/**
* The external service's project.
*/
project: string
/**
* A unique identifier of the external issue.
*/
identifier: string
[k: string]: unknown
}
Submitted by hugo697 235 days ago