Post work report comments to JIRA tickets from worklog.yml
Posts worklog summaries to JIRA tickets from a YAML worklog file.
/plugin marketplace add bryan-cox/taskledger/plugin install taskledger@taskledger[--file PATH] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--dry-run]taskledger:update-jira
/taskledger:update-jira [--file PATH] [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD] [--dry-run]
Reads a worklog.yml file, generates a formatted status update comment for each JIRA ticket referenced in the tasks, checks for duplicate comments to avoid spam, and posts the updates to JIRA using the Atlassian MCP server.
This command is useful for:
worklog.yml file must exist (either at the specified path or in the current working directory)Execute the following workflow step by step:
Extract optional arguments from $ARGUMENTS:
--file PATH: Path to worklog.yml file (defaults to ./worklog.yml in current directory)--start-date YYYY-MM-DD: Start of date range (defaults to today)--end-date YYYY-MM-DD: End of date range (defaults to today)--dry-run: Preview mode - show what would be posted without actually postingValidate date formats if provided (must be YYYY-MM-DD)
Store the file path and dry-run flag for later use
Read the worklog.yml file from the specified path (or current directory if not specified) using the Read tool
Parse the YAML content. The structure is:
"YYYY-MM-DD":
work_log:
- start_time: "HH:MM"
end_time: "HH:MM"
tasks:
- jira_ticket: "PROJ-123"
description: "Task description"
descriptions: ["Multiple", "descriptions"]
status: "completed" # or "in progress" or "not started"
github_pr: "https://github.com/..."
upnext_description: "Next steps"
blocker: "Blocking issue"
Filter entries to only include dates within the specified range (inclusive)
If no tasks found in range, inform the user and exit:
No tasks found in worklog.yml for the date range {start-date} to {end-date}.
Create a map of jira_ticket -> list of tasks across all dates in range
For each unique jira_ticket, collect:
description and descriptions fields)Skip tasks without a jira_ticket value (they cannot be updated in JIRA)
Extract the ticket ID from each jira_ticket field:
https://issues.redhat.com/browse/PROJ-123, extract PROJ-123PROJ-123, use it directly[A-Z]+-\d+ formatFor each unique JIRA ticket, generate a comment in Jira wiki markup format:
h2. Status Update: {start-date} to {end-date}
*Work Completed:*
* {description 1}
* {description 2}
* {description N}
*Pull Requests:*
* [{PR URL short name}|{full PR URL}]
*Next Steps:* {upnext_description}
*Blockers:* {blocker text}
----
_Generated via TaskLedger /update-jira_
Rules for formatting:
[Display Text|URL]For each ticket that will be updated:
Fetch the issue with comments using mcp__atlassian__jira_get_issue:
issue_key: "{TICKET-ID}"
comment_limit: 20
expand: "renderedFields"
Parse the comments and check if any contain BOTH:
If a duplicate is found, mark the ticket as having an existing comment
Display a summary to the user:
=== JIRA Update Preview ===
Date Range: {start-date} to {end-date}
Tickets to update:
1. {TICKET-1}: {summary from JIRA} - {N} work items
2. {TICKET-2}: {summary from JIRA} - {N} work items
[DUPLICATE - comment already exists for this date range]
--- Comment Preview for {TICKET-1} ---
{full comment content}
---
Dry run: {yes/no}
If NOT in dry-run mode, ask for confirmation:
Post these comments to JIRA?
- yes: Post all comments (skip duplicates)
- all: Post all comments (including duplicates)
- no: Cancel
If in dry-run mode:
Dry run complete. No comments were posted.
To post comments, run without --dry-run flag.
If user confirms with "yes" or "all":
For each ticket (skipping duplicates unless user said "all"):
Use mcp__atlassian__jira_add_comment:
issue_key: "{TICKET-ID}"
comment: "{generated comment content}"
Track success/failure for each ticket
Report results:
=== JIRA Update Results ===
Posted successfully:
- TICKET-1: https://issues.redhat.com/browse/TICKET-1
- TICKET-2: https://issues.redhat.com/browse/TICKET-2
Skipped (duplicates):
- TICKET-3: Comment already exists for this date range
Errors:
- TICKET-4: {error message}
Preview what would be posted (dry run):
/update-jira --dry-run
Shows all tickets and comments without posting anything.
Update tickets for today:
/update-jira
Posts comments for all tasks logged today.
Update tickets for a specific date range:
/update-jira --start-date 2025-01-06 --end-date 2025-01-07
Posts comments summarizing work from Jan 6-7.
Update tickets for past week:
/update-jira --start-date 2025-01-01
Posts comments from Jan 1 to today.
Use a worklog file from a different location:
/update-jira --file ~/worklog/worklog.yaml
Uses the worklog file from the specified path.
Combine file path with date range:
/update-jira --file /path/to/worklog.yml --start-date 2025-01-06 --end-date 2025-01-07 --dry-run
Preview comments for a specific date range using a custom worklog file.
--file (optional): Path to the worklog.yml file. Defaults to ./worklog.yml in the current directory. Can be an absolute or relative path.--start-date (optional): Start of date range in YYYY-MM-DD format. Defaults to today.--end-date (optional): End of date range in YYYY-MM-DD format. Defaults to today.--dry-run (optional): Preview mode. Shows what would be posted without actually posting to JIRA.report command for generating text/HTML reportshours command for calculating hours worked