Skip to content

Commit d8434a1

Browse files
committed
update jira contract
1 parent ed1a875 commit d8434a1

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

apps/sim/app/api/tools/jira/write/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
9595
fields.description = toAdf(description)
9696
}
9797

98-
if (parent !== undefined && parent !== null && parent !== '') {
98+
if (parent !== undefined && parent !== null) {
9999
fields.parent = parent
100100
}
101101

apps/sim/lib/api/contracts/selectors/jira.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ export const jiraIssuesBodySchema = z.object({
6363
issueKeys: z.array(z.string().min(1)).default([]),
6464
})
6565

66+
export const jiraParentReferenceSchema = z.union([
67+
z.object({ key: z.string().min(1) }).passthrough(),
68+
z.object({ id: z.string().min(1) }).passthrough(),
69+
])
70+
export type JiraParentReference = z.input<typeof jiraParentReferenceSchema>
71+
6672
export const jiraWriteBodySchema = z.object({
6773
domain: z.string({ error: 'Domain is required' }).min(1, 'Domain is required'),
6874
accessToken: z.string({ error: 'Access token is required' }).min(1, 'Access token is required'),
@@ -73,7 +79,7 @@ export const jiraWriteBodySchema = z.object({
7379
assignee: z.string().optional(),
7480
cloudId: z.string().optional(),
7581
issueType: z.string().optional(),
76-
parent: z.string().optional(),
82+
parent: jiraParentReferenceSchema.optional(),
7783
labels: z.array(z.string()).optional(),
7884
duedate: z.string().optional(),
7985
reporter: z.string().optional(),

0 commit comments

Comments
 (0)