:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { MakeLogicType, actions, kea, key, path, props } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { JiraProjectType } from '~/types'
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface jiraIntegrationLogicValues {
jiraProjects: JiraProjectType[]
jiraProjectsLoading: boolean
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface jiraIntegrationLogicActions {
loadJiraProjects: () => {}
loadJiraProjectsFailure: (
error: string,
errorObject?: any
) => {
error: string
errorObject?: any
}
loadJiraProjectsSuccess: (
jiraProjects: JiraProjectType[],
payload?: {}
) => {
jiraProjects: JiraProjectType[]
payload?: {}
}
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface jiraIntegrationLogicProps {
id: number
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface jiraIntegrationLogicMeta {
key: number
}
export type jiraIntegrationLogicType = MakeLogicType<
jiraIntegrationLogicValues,
jiraIntegrationLogicActions,
jiraIntegrationLogicProps,
jiraIntegrationLogicMeta
>
export const jiraIntegrationLogic = kea<jiraIntegrationLogicType>([
props({} as { id: number }),
key((props) => props.id),
path((key) => ['lib', 'integrations', 'jiraIntegrationLogic', key]),
actions({
loadJiraProjects: () => ({}),
}),
loaders(({ props }) => ({
jiraProjects: [
[] as JiraProjectType[],
{
loadJiraProjects: async () => {
const res = await api.integrations.jiraProjects(props.id)
return res.projects
},
},
],
})),
])