feat(jira): support raw ADF in description and environment fields#4164
feat(jira): support raw ADF in description and environment fields#4164waleedlatif1 merged 8 commits intostagingfrom
Conversation
…ttern Simplified regex to eliminate overlapping quantifiers that caused exponential backtracking on malformed input without closing delimiter.
…onment fields Add toAdf() helper that passes through ADF objects as-is or wraps plain text in a single-paragraph ADF doc. Update write and update routes to use it, replacing inline ADF wrapping. Update Zod schema to accept string or object for description. Fully backward compatible — plain text still works, but callers can now pass rich ADF with expand nodes, tables, code blocks, etc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview This introduces a shared Reviewed by Cursor Bugbot for commit d799f3a. Configure here. |
Greptile SummaryThis PR adds a
Confidence Score: 4/5Safe to merge once the TypeScript interface types are widened — the runtime behaviour is correct but the type system currently rejects the new feature. The route logic and toAdf implementation are solid, but JiraUpdateParams and JiraWriteParams still declare description and environment as string-only, meaning any typed caller trying to use the advertised ADF object support will hit a TypeScript compile error. That is a present type-correctness defect, not a speculative concern. apps/sim/tools/jira/types.ts — description and environment fields need widening in both JiraUpdateParams and JiraWriteParams Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Caller passes description / environment] --> B{typeof value}
B -->|object| C{value.type === 'doc'?}
C -->|yes| D[Return as-is]
C -->|no| E{value.type && Array.isArray content?}
E -->|yes| F[Wrap in doc envelope]
E -->|no| G[JSON.stringify as plain text]
B -->|string| H{JSON.parse succeeds?}
H -->|yes, type==='doc'| D
H -->|yes, type + content array| F
H -->|yes, other JSON| I[Treat original string as plain text]
H -->|no, parse error| I
I --> J[Wrap in paragraph ADF]
F --> K[Valid ADF document]
D --> K
G --> J
J --> K
K --> L[POST/PUT to Jira API]
|
Wrap partial ADF nodes (type + content but not doc) in a doc envelope. Fall back to JSON.stringify for non-ADF objects instead of String() which produces [object Object]. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion The executor's formatValueForBlock() JSON.stringify's object values when resolving <Block.output> references. This means an ADF object from an upstream Agent block arrives at the route as a JSON string. toAdf() now detects JSON strings containing valid ADF documents or nodes and parses them back, ensuring rich formatting is preserved through the pipeline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
Match the description field schema change — environment also passes through toAdf() so its Zod schema must accept objects too. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d799f3a. Configure here.
Summary
toAdf()helper tojira/utils.ts— passes through ADF document objects as-is, wraps plain text strings in single-paragraph ADFwriteandupdateroutes to usetoAdf(), replacing inline ADF wrappingupdateroute Zod schema to acceptstring | objectfor descriptionTest plan