Skip to content

Add Jira Issues to Google sheets prebuilt integration - #54

Open
SashenkaG wants to merge 15 commits into
wso2:mainfrom
SashenkaG:main
Open

Add Jira Issues to Google sheets prebuilt integration#54
SashenkaG wants to merge 15 commits into
wso2:mainfrom
SashenkaG:main

Conversation

@SashenkaG

@SashenkaG SashenkaG commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Feature: Jira to Google Sheets Automation

Description

This pull request introduces a new prebuilt Ballerina integration that automates the extraction of Jira issues to Google Sheets. It includes the complete implementation of the automation logic, configuration models, data mappings, connection setup, and comprehensive documentation.

Key Changes

1. Core Automation Logic (automation.bal)

  • Implemented the main workflow (runAutomation): Queries Jira for issues using dynamically generated JQL based on the provided configuration.
  • Added Time Frame Filtering: Supports predefined time frames (YESTERDAY, LAST_WEEK, LAST_MONTH, LAST_QUARTER) to filter issues seamlessly.
  • Enhanced Data Extraction: Explicitly requests the fields (summary, status, assignee, created, duedate) from Jira to optimize API performance and response parsing.

2. Documentation and Developer Guidance

  • Added README.md and instructions.md: Covers prerequisites, configuration (Jira tokens, Google OAuth), deployment steps, and setup guides.
  • Added Flow Diagram (diagram.md): Includes a Mermaid flow diagram illustrating the integration process and decision logic.

Related Issues

Resolves Issue #66

Testing Notes

  • Verified that when spreadsheetId is provided, a new tab is correctly appended to the existing file.
  • Verified that when spreadsheetId is not provided, a new spreadsheet is successfully created in Google Drive.
  • Confirmed that JQL time filters accurately append the -1d, -7d, etc., syntax required by Jira.
  • Handled edge cases where the Jira project returns 0 issues gracefully.

Summary by CodeRabbit

  • New Features

    • Jira-to-Google Sheets integration: automated export of Jira issues into timestamped spreadsheets, selectable timeframes (YESTERDAY, LAST_WEEK, LAST_MONTH, LAST_QUARTER, ALL), and option to reuse an existing spreadsheet; includes a runnable automation entry point.
  • Documentation

    • Added detailed setup and configuration guides for Jira and Google authentication, example parameters, and deployment/scheduling instructions.
  • Quality of Life

    • Added ignore rules for build artifacts and local config files.

@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new Ballerina integration project "jira-issues-to-googlesheets" that fetches Jira issues via JQL, transforms them, and appends results to a timestamped Google Sheets spreadsheet; includes schema, docs, clients, automation logic, types, and mapping/utilities.

Changes

Cohort / File(s) Summary
Repository Manifest & CI
.github/workflows/projects.json
Appends a new project entry for ballerina-integrator/jira-issues-to-googlesheets.
Project Manifest & VCS
ballerina-integrator/jira-issues-to-googlesheets/Ballerina.toml, ballerina-integrator/jira-issues-to-googlesheets/.gitignore
Adds project metadata and standard ignore rules for build artifacts and config.
Choreo Schema & Docs
ballerina-integrator/jira-issues-to-googlesheets/.choreo/config-schema.json, ballerina-integrator/jira-issues-to-googlesheets/.choreo/diagram.md, ballerina-integrator/jira-issues-to-googlesheets/.choreo/instructions.md
Adds JSON Schema for Jira & Google Sheets config and Ballerina logging; provides flow diagram and detailed setup/deployment instructions (Jira auth, OAuth scopes, timeFrame behavior).
User Documentation
ballerina-integrator/jira-issues-to-googlesheets/README.md
New README describing purpose, exported fields, prerequisites, configuration options, and deployment steps.
Connections & Config
ballerina-integrator/jira-issues-to-googlesheets/connections.bal, .../config.bal
Initializes Jira and Google Sheets clients using configured credentials; introduces configurable records and a public TimeFrame enum with default.
Core Automation
ballerina-integrator/jira-issues-to-googlesheets/automation.bal, ballerina-integrator/jira-issues-to-googlesheets/main.bal
Implements runAutomation() and getOrCreateSpreadsheet(), builds JQL by timeframe, fetches issues, creates/uses spreadsheet (or uses configured ID), appends headers+rows, logs and propagates errors; exposes public entry point.
Data Modeling & Mapping
ballerina-integrator/jira-issues-to-googlesheets/types.bal, .../data_mappings.bal, .../functions.bal
Adds public SheetRow type and internal IssueData types; provides bean→IssueData conversion, date formatting, timestamp utility, and mapIssueToRow with null-safe assignee handling.

Sequence Diagram

sequenceDiagram
    participant User
    participant Main as main()
    participant Automation as runAutomation()
    participant Jira as Jira Client
    participant Transform as Data Transform
    participant Sheets as Google Sheets Client

    User->>Main: Invoke
    Main->>Automation: runAutomation()
    Automation->>Automation: Determine TimeFrame & build JQL
    Automation->>Jira: Fetch issues via JQL
    Jira-->>Automation: Return issues
    Automation->>Transform: convertBeanToIssueData / mapIssueToRow
    Transform-->>Automation: Return IssueData / SheetRow
    Automation->>Automation: getOrCreateSpreadsheet(name)
    Automation->>Sheets: Create/retrieve spreadsheet
    Sheets-->>Automation: Return spreadsheetId & sheet
    Automation->>Sheets: Append rows (headers + data)
    Sheets-->>Automation: Append result
    Automation-->>Main: Success or error
    Main-->>User: Log result
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through Jira fields with care,
Collected keys and statuses to share,
I stamped a sheet with time and name,
Pushed rows in order, neat and tame,
Now issues dance in cells aflare.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a reasonable overview of key changes but deviates significantly from the template structure. Critical sections like Purpose, Goals, Release notes, Documentation, Security checks, and Test environment are missing or incomplete. Align the description with the template by adding Purpose with issue links, Goals, comprehensive Release notes, Documentation links, Security checks confirmation, and Test environment details.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: adding a new Jira-to-Google Sheets prebuilt integration, which aligns with the substantial changeset across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (2)
ballerina-integrator/jira_to_googlesheets/data_mappings.bal (1)

9-9: Make SheetRow positional instead of a generic array.

Right now this mapper and the header row in automation.bal stay aligned by convention only. Defining SheetRow as a six-element tuple in types.bal would turn accidental column reordering into a compile-time error instead of silent sheet corruption.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/jira_to_googlesheets/data_mappings.bal` at line 9,
Define SheetRow as a fixed six-element tuple in types.bal (e.g., SheetRow with
six specific element types) and change the mapper function in data_mappings.bal
to return SheetRow instead of a generic array; update the function signature
that produces [key, summary, status, assignee, created, dueDate] to return
SheetRow so the tuple literal matches the new type, and adjust any usages (like
the header row in automation.bal) to use the SheetRow type to get compile-time
checks for column count/order.
ballerina-integrator/jira_to_googlesheets/functions.bal (1)

72-81: Avoid letting TZ silently override timezone.

A process-level TZ currently wins over the explicit module config, so identical Ballerina configs can generate different sheet names across environments. Prefer timezone as the source of truth, or only consult TZ when timezone is empty.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/jira_to_googlesheets/functions.bal` around lines 72 -
81, The current getFormattedCurrentTimeStamp() lets process env TZ override the
module config variable timezone; change the logic so the module config variable
timezone is preferred: initialize detectedTz from timezone and only if timezone
is empty/blank then read os:getEnv("TZ") into tzEnv and use it (fall back to
"UTC" if both are empty). Update the function getFormattedCurrentTimeStamp(),
keeping the variables detectedTz, tzEnv and the "UTC" fallback, but ensure TZ is
consulted only when timezone is empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ballerina-integrator/jira_to_googlesheets/.choreo/config-schema.json`:
- Around line 181-189: The JSON Schema entry for the "spreadsheetId" property
contains an invalid empty type value ("type": "") inside the anyOf array;
replace the anyOf block with a single valid type declaration by removing the
anyOf array and setting "type": "string" for the "spreadsheetId" property so the
schema conforms to Draft-07 and no longer contains an empty type entry.

In `@ballerina-integrator/jira_to_googlesheets/.choreo/diagram.md`:
- Around line 1-10: Add the missing Mermaid header and styling, define classDef
entries for startNode, processNode, decisionNode, and endNode (so the styles
apply), and extend the flow by adding a new decision node D ("Spreadsheet ID
Configured?") plus nodes E ("Use Existing Spreadsheet (Add New Tab)"), F
("Create Google Sheet with Timestamp"), G ("Populate Sheet with Data") and H
(end) and update the links: A -> B -> C, C -- Yes --> D, D -- Yes --> E --> G
--> H, D -- No --> F --> G --> H, and C -- No --> H; keep original node IDs
(A,B,C) and reuse the process/decision node class names to match the code path
for getOrCreateSpreadsheet().

In `@ballerina-integrator/jira_to_googlesheets/.choreo/instructions.md`:
- Around line 3-5: Update the Overview so it accurately reflects the
configurable flows: state that the automation either creates a new timestamped
Google Sheets spreadsheet or appends to an existing spreadsheet when a non-empty
spreadsheetId is provided, and that issue selection is either "all issues" or
filtered by the timeFrame parameter; modify the sentences that currently assert
creation of a new sheet and querying all issues to be conditional (mention
spreadsheetId and timeFrame by name) and mirror these changes in the later
Overview lines referenced (lines 47-59) so the doc consistently describes both
flows.

In `@ballerina-integrator/jira_to_googlesheets/automation.bal`:
- Around line 14-15: The timestamp is being generated at module scope
(currentTimeStamp using getFormattedCurrentTimeStamp), causing reuse across
invocations; move the call into runAutomation() so a fresh timestamp is produced
each run. Locate the module-level string currentTimeStamp and replace its
initialization with a local variable inside the runAutomation() function (call
getFormattedCurrentTimeStamp() there) and update any references to use the local
variable so tab names are unique per invocation.
- Around line 65-71: The code incorrectly treats an empty jira:IssueBean[] as an
error; instead, remove the error return in the block that checks issueBeans is
jira:IssueBean[] and ensure empty results are handled as a valid empty list:
when issueBeans.length() == 0 simply set issues to an empty array (or allow the
list comprehension to produce an empty array) rather than returning error, so
that both the nil case and the empty-array case behave consistently; update the
block around issueBeans / convertBeanToIssueData to map beans to issues
(yielding [] if none) and remove the error("No Jira issues found...") branch.
- Around line 98-100: The on fail error e block in automation.bal currently logs
the error then returns () which swallows failures; change it to propagate the
error instead (e.g., replace the “return ();” in the on fail error e handler
with a propagation like “return err e;” or rethrow so callers/schedulers can
observe retries/alerts) and ensure the surrounding function signature (the
function containing the on fail error e block) allows returning/propagating an
error (e.g., returns error? or returns error).

In `@ballerina-integrator/jira_to_googlesheets/README.md`:
- Around line 5-6: Update the README to document the "existing-spreadsheet"
path: explain that when spreadsheetId is provided the integration will append a
new worksheet/tab to that existing spreadsheet rather than creating a new
timestamped spreadsheet; list and describe the configuration keys spreadsheetId
(optional: when set use existing spreadsheet and create a new sheet/tab),
timeFrame (format and how it filters Jira issues, e.g., "last 7d" or JQL date
range behavior) and timeZone (how dates are interpreted and impacts issue
selection and sheet timestamps), and add a short usage note/examples so
operators understand when to supply or omit spreadsheetId; also apply the same
edits to the other README section referenced (lines 47-63).
- Around line 41-43: The Google OAuth scopes listed in README.md (the two
entries `https://www.googleapis.com/auth/spreadsheets` and
`https://www.googleapis.com/auth/drive.file`) conflict with the scopes in
.choreo/instructions.md; update the scope list so both documents use the exact
same scope set (either replace `https://www.googleapis.com/auth/drive.file` with
`https://www.googleapis.com/auth/drive` in README.md or change
.choreo/instructions.md to `drive.file`) and ensure the scope strings
(`https://www.googleapis.com/auth/spreadsheets`,
`https://www.googleapis.com/auth/drive` or
`https://www.googleapis.com/auth/drive.file`) match verbatim across both files.

---

Nitpick comments:
In `@ballerina-integrator/jira_to_googlesheets/data_mappings.bal`:
- Line 9: Define SheetRow as a fixed six-element tuple in types.bal (e.g.,
SheetRow with six specific element types) and change the mapper function in
data_mappings.bal to return SheetRow instead of a generic array; update the
function signature that produces [key, summary, status, assignee, created,
dueDate] to return SheetRow so the tuple literal matches the new type, and
adjust any usages (like the header row in automation.bal) to use the SheetRow
type to get compile-time checks for column count/order.

In `@ballerina-integrator/jira_to_googlesheets/functions.bal`:
- Around line 72-81: The current getFormattedCurrentTimeStamp() lets process env
TZ override the module config variable timezone; change the logic so the module
config variable timezone is preferred: initialize detectedTz from timezone and
only if timezone is empty/blank then read os:getEnv("TZ") into tzEnv and use it
(fall back to "UTC" if both are empty). Update the function
getFormattedCurrentTimeStamp(), keeping the variables detectedTz, tzEnv and the
"UTC" fallback, but ensure TZ is consulted only when timezone is empty.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ccbe92f2-0a5a-42cc-9be6-fb54b4990bb1

📥 Commits

Reviewing files that changed from the base of the PR and between c7cb295 and 0ff8cb2.

📒 Files selected for processing (14)
  • ballerina-integrator/jira_to_googlesheets/.choreo/config-schema.json
  • ballerina-integrator/jira_to_googlesheets/.choreo/diagram.md
  • ballerina-integrator/jira_to_googlesheets/.choreo/instructions.md
  • ballerina-integrator/jira_to_googlesheets/.gitignore
  • ballerina-integrator/jira_to_googlesheets/Ballerina.toml
  • ballerina-integrator/jira_to_googlesheets/README.md
  • ballerina-integrator/jira_to_googlesheets/agents.bal
  • ballerina-integrator/jira_to_googlesheets/automation.bal
  • ballerina-integrator/jira_to_googlesheets/config.bal
  • ballerina-integrator/jira_to_googlesheets/connections.bal
  • ballerina-integrator/jira_to_googlesheets/data_mappings.bal
  • ballerina-integrator/jira_to_googlesheets/functions.bal
  • ballerina-integrator/jira_to_googlesheets/main.bal
  • ballerina-integrator/jira_to_googlesheets/types.bal

Comment thread ballerina-integrator/jira_to_googlesheets/.choreo/config-schema.json Outdated
Comment thread ballerina-integrator/jira_to_googlesheets/automation.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/automation.bal Outdated
Comment thread ballerina-integrator/jira_to_googlesheets/automation.bal Outdated
Comment thread ballerina-integrator/jira_to_googlesheets/README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
ballerina-integrator/jira_to_googlesheets/automation.bal (1)

14-25: Consider defensive check when accessing spreadsheet.sheets[0].

While Google Sheets API guarantees a newly created spreadsheet has at least one sheet, accessing spreadsheet.sheets[0] without a bounds check could cause a runtime panic if the API behavior ever changes or returns unexpected data.

🛡️ Optional defensive check
     sheets:Spreadsheet spreadsheet = check sheetsClient->createSpreadsheet(name = sheetName);
     log:printInfo("Spreadsheet created with name: " + sheetName);
+    if spreadsheet.sheets.length() == 0 {
+        return error("Created spreadsheet has no sheets");
+    }
     return [spreadsheet.spreadsheetId, spreadsheet.sheets[0]];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/jira_to_googlesheets/automation.bal` around lines 14 -
25, The function getOrCreateSpreadsheet currently returns spreadsheet.sheets[0]
without verifying the sheets array; add a defensive check after creating the
sheets:Spreadsheet (referencing the sheets:Spreadsheet variable named
spreadsheet and the access spreadsheet.sheets[0]) to ensure spreadsheet.sheets
is not nil and has length > 0, and if it is empty return a helpful error (or
create a default sheet) instead of indexing into an empty array; update the
return path to only use spreadsheet.sheets[0] when the check passes and
otherwise return an error describing the unexpected empty sheets list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ballerina-integrator/jira_to_googlesheets/automation.bal`:
- Around line 14-25: The function getOrCreateSpreadsheet currently returns
spreadsheet.sheets[0] without verifying the sheets array; add a defensive check
after creating the sheets:Spreadsheet (referencing the sheets:Spreadsheet
variable named spreadsheet and the access spreadsheet.sheets[0]) to ensure
spreadsheet.sheets is not nil and has length > 0, and if it is empty return a
helpful error (or create a default sheet) instead of indexing into an empty
array; update the return path to only use spreadsheet.sheets[0] when the check
passes and otherwise return an error describing the unexpected empty sheets
list.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1596b70-9863-4448-a717-d44ab27cbdf8

📥 Commits

Reviewing files that changed from the base of the PR and between 0ff8cb2 and ebe63b9.

📒 Files selected for processing (4)
  • ballerina-integrator/jira_to_googlesheets/.choreo/config-schema.json
  • ballerina-integrator/jira_to_googlesheets/README.md
  • ballerina-integrator/jira_to_googlesheets/automation.bal
  • ballerina-integrator/jira_to_googlesheets/config.bal
🚧 Files skipped from review as they are similar to previous changes (2)
  • ballerina-integrator/jira_to_googlesheets/README.md
  • ballerina-integrator/jira_to_googlesheets/.choreo/config-schema.json

@hasathcharu

hasathcharu commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Prebuilt Integration Checklist

  • github/workflows/projects.json is updated with the new prebuilt integration path
  • Directory path is delimited by '-'
  • Path in the .github/workflows/projects.json matches the project path exactly
  • Directory path is identical to the integration name in Ballerina.toml
  • README.MD is correctly structured
  • Configurations are organized by records based on vendor
  • choreo/config-schema.json exists and is up to date
  • choreo/instructions.md is correctly structured
  • choreo/diagram.md is correctly written and parsable by Mermaid
  • choreo/component.yaml exists for service type integrations
  • choreo/openapi.yaml exists for service type integrations

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
ballerina-integrator/jira-issues-to-googlesheets/.choreo/diagram.md (1)

1-10: ⚠️ Potential issue | 🟡 Minor

Add Mermaid diagram declaration, classDef statements, and model the conditional spreadsheet logic.

This was previously flagged and still needs to be addressed:

  1. Missing the required flowchart TD declaration at the top—Mermaid parsers require an explicit diagram type.
  2. Missing classDef declarations for startNode, processNode, decisionNode, and endNode—the :::className references have no effect without them.
  3. The flow omits the conditional path for reusing an existing spreadsheet. Per the PR objectives, when spreadsheetId is provided, the integration appends a new tab; when not provided, it creates a new spreadsheet. Add a decision node after C to branch between these two paths.
📊 Corrected diagram structure
flowchart TD
    classDef startNode fill:`#90EE90`
    classDef endNode fill:`#FFB6C6`
    classDef processNode fill:`#87CEEB`
    classDef decisionNode fill:`#FFD700`

    A(["Begin"]):::startNode
    B["Fetch Issues from Jira"]:::processNode
    C{"Are there<br/>Issues?"}:::decisionNode
    D{"Spreadsheet ID<br/>Configured?"}:::decisionNode
    E["Use Existing Spreadsheet<br/>(Add New Tab)"]:::processNode
    F["Create Google Sheet with Timestamp"]:::processNode
    G["Populate Sheet with Data"]:::processNode
    H(["Complete"]):::endNode

    A --> B --> C
    C -- Yes --> D
    D -- Yes --> E --> G --> H
    D -- No --> F --> G --> H
    C -- No --> H
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ballerina-integrator/jira-issues-to-googlesheets/.choreo/diagram.md` around
lines 1 - 10, Add the missing Mermaid diagram declaration and style definitions,
and model the conditional spreadsheet logic: prepend "flowchart TD" to the
diagram, add classDef entries for startNode, processNode, decisionNode, and
endNode so the :::className markers on nodes A, B, C, F, and end node render,
and insert a new decision node (e.g., D{"Spreadsheet
ID<br/>Configured?"}:::decisionNode) after C that branches to an "Use Existing
Spreadsheet (Add New Tab)" process node when spreadsheetId is provided and to
the existing "Create Google Sheet with Timestamp" process node when not
provided; update the links so C -- Yes --> D, D -- Yes --> (existing-sheet node)
--> E/G --> H, and D -- No --> (create-sheet node) --> E/G --> H, keeping the C
-- No --> H path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ballerina-integrator/jira-issues-to-googlesheets/.choreo/config-schema.json`:
- Around line 11-25: The JSON schema currently allows empty strings for required
credential fields; update the schema by adding "minLength": 1 to each required
string property to prevent empty values—specifically add minLength: 1 to
jiraConfig properties baseUrl, email, apiToken, projectKey and to
googleSheetsConfig properties refreshToken, clientId, clientSecret so validation
fails on empty strings rather than at runtime.

In `@ballerina-integrator/jira-issues-to-googlesheets/.choreo/instructions.md`:
- Around line 45-46: Documentation uses the key "timeZone" but the config schema
defines "timezone"; make them identical by renaming the schema property
"timezone" to "timeZone" (or vice‑versa if you prefer snake/lowercase) and
update any code that reads the config (the parser/validation that references the
schema) to use the chosen key; ensure the config-schema.json property name and
the instructions.md key are the same and run a quick validation of reading the
value (e.g., in the config loading/validation function) to avoid regressions.

In `@ballerina-integrator/jira-issues-to-googlesheets/automation.bal`:
- Around line 54-59: The current call to check jiraClient->/api/'3/search/jql
only fetches the first page (jira:SearchAndReconcileResults result) and assigns
result.issues once; change this to loop and accumulate all pages: call the
endpoint repeatedly, passing result.nextPageToken (or startAt/nextPageToken) on
subsequent requests, append each response.issues into a single jira:IssueBean[]
accumulator, and stop when the response indicates isLast (or no nextPageToken);
only after accumulation map the full issue list to sheet rows. Ensure you
reference the existing call to check jiraClient->/api/'3/search/jql, the result
variable, result.issues, result.isLast and result.nextPageToken when
implementing the loop.

In `@ballerina-integrator/jira-issues-to-googlesheets/functions.bal`:
- Around line 72-88: The function getFormattedCurrentTimeStamp currently lets
the OS TZ env var override the configured timezone (variable timezone), causing
surprising precedence; change the logic to ignore TZ and use only the configured
timezone: remove the os:getEnv("TZ") check and the tzEnv override (references:
timezone, tzEnv, os:getEnv("TZ"), getFormattedCurrentTimeStamp, time:getZone),
so detectedTz is derived solely from timezone (falling back to "UTC" if empty)
before calling time:getZone, and ensure the error path still returns a clear
"Invalid time zone: <detectedTz>" error.

---

Duplicate comments:
In `@ballerina-integrator/jira-issues-to-googlesheets/.choreo/diagram.md`:
- Around line 1-10: Add the missing Mermaid diagram declaration and style
definitions, and model the conditional spreadsheet logic: prepend "flowchart TD"
to the diagram, add classDef entries for startNode, processNode, decisionNode,
and endNode so the :::className markers on nodes A, B, C, F, and end node
render, and insert a new decision node (e.g., D{"Spreadsheet
ID<br/>Configured?"}:::decisionNode) after C that branches to an "Use Existing
Spreadsheet (Add New Tab)" process node when spreadsheetId is provided and to
the existing "Create Google Sheet with Timestamp" process node when not
provided; update the links so C -- Yes --> D, D -- Yes --> (existing-sheet node)
--> E/G --> H, and D -- No --> (create-sheet node) --> E/G --> H, keeping the C
-- No --> H path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a346b20-de59-451d-a239-8f132d22f69b

📥 Commits

Reviewing files that changed from the base of the PR and between ebe63b9 and fa3b6f5.

📒 Files selected for processing (15)
  • .github/workflows/projects.json
  • ballerina-integrator/jira-issues-to-googlesheets/.choreo/config-schema.json
  • ballerina-integrator/jira-issues-to-googlesheets/.choreo/diagram.md
  • ballerina-integrator/jira-issues-to-googlesheets/.choreo/instructions.md
  • ballerina-integrator/jira-issues-to-googlesheets/.gitignore
  • ballerina-integrator/jira-issues-to-googlesheets/Ballerina.toml
  • ballerina-integrator/jira-issues-to-googlesheets/README.md
  • ballerina-integrator/jira-issues-to-googlesheets/agents.bal
  • ballerina-integrator/jira-issues-to-googlesheets/automation.bal
  • ballerina-integrator/jira-issues-to-googlesheets/config.bal
  • ballerina-integrator/jira-issues-to-googlesheets/connections.bal
  • ballerina-integrator/jira-issues-to-googlesheets/data_mappings.bal
  • ballerina-integrator/jira-issues-to-googlesheets/functions.bal
  • ballerina-integrator/jira-issues-to-googlesheets/main.bal
  • ballerina-integrator/jira-issues-to-googlesheets/types.bal
✅ Files skipped from review due to trivial changes (1)
  • ballerina-integrator/jira-issues-to-googlesheets/Ballerina.toml

Comment thread ballerina-integrator/jira-issues-to-googlesheets/.choreo/instructions.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ballerina-integrator/jira-issues-to-googlesheets/.choreo/config-schema.json`:
- Around line 206-208: Remove the undocumented non-standard JSON Schema property
"requiredLevel" (currently set to 3) from the schema so only valid
draft-07/Choreo keywords remain; delete the "requiredLevel": 3 entry (it sits
alongside "additionalProperties": false) and ensure the resulting JSON remains
valid (update trailing commas if any) and that no code references the
"requiredLevel" key elsewhere before committing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82a7d6a8-2be9-461f-87b1-60fd256ca918

📥 Commits

Reviewing files that changed from the base of the PR and between fa3b6f5 and f935ea3.

📒 Files selected for processing (1)
  • ballerina-integrator/jira-issues-to-googlesheets/.choreo/config-schema.json

Comment thread ballerina-integrator/jira-issues-to-googlesheets/.gitignore Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new prebuilt Ballerina automation under ballerina-integrator/jira-issues-to-googlesheets to export Jira issues to Google Sheets, including Choreo metadata and repository registration so it can be built/deployed as part of the prebuilt integrations set.

Changes:

  • Implement Jira issue query + mapping + Google Sheets append workflow with configurable time-frame filtering.
  • Add configuration models, connector initialization, and Jira-to-row transformation helpers.
  • Add Choreo documentation/artifacts and register the new project in .github/workflows/projects.json.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ballerina-integrator/jira-issues-to-googlesheets/types.bal Defines internal Jira issue and Sheets row types used across the integration.
ballerina-integrator/jira-issues-to-googlesheets/main.bal Entrypoint that starts the automation and invokes runAutomation().
ballerina-integrator/jira-issues-to-googlesheets/functions.bal Helpers for Jira issue bean extraction and timestamp formatting.
ballerina-integrator/jira-issues-to-googlesheets/data_mappings.bal Maps extracted Jira issue data into a Sheets row structure.
ballerina-integrator/jira-issues-to-googlesheets/connections.bal Initializes Jira and Google Sheets connector clients from configurable values.
ballerina-integrator/jira-issues-to-googlesheets/config.bal Declares configurable auth/settings and the TimeFrame enum.
ballerina-integrator/jira-issues-to-googlesheets/automation.bal Core workflow: builds JQL, fetches issues, creates/opens spreadsheet, appends rows.
ballerina-integrator/jira-issues-to-googlesheets/agents.bal Placeholder agents file (currently empty).
ballerina-integrator/jira-issues-to-googlesheets/README.md End-user documentation for setup, config, and deployment.
ballerina-integrator/jira-issues-to-googlesheets/Ballerina.toml Package metadata for the new integration.
ballerina-integrator/jira-issues-to-googlesheets/.gitignore Ignores build outputs and local Config.toml.
ballerina-integrator/jira-issues-to-googlesheets/.choreo/instructions.md Choreo instructions for prerequisites and configuration.
ballerina-integrator/jira-issues-to-googlesheets/.choreo/diagram.md Flow diagram describing the automation steps/decision points.
ballerina-integrator/jira-issues-to-googlesheets/.choreo/config-schema.json Choreo config schema for required runtime configuration.
.github/workflows/projects.json Registers the new integration path for CI/workflow processing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ballerina-integrator/jira-issues-to-googlesheets/automation.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/.choreo/instructions.md Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/types.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/types.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/automation.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/automation.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/config.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/functions.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/functions.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/functions.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/functions.bal Outdated
Comment thread ballerina-integrator/jira-issues-to-googlesheets/functions.bal Outdated
hasathcharu
hasathcharu previously approved these changes Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants