Skip to content

netresearch/jira-skill / skills/jira-communication

jira-communication

Flagged

Use when handling Jira issues, sprints, boards, links, fields, worklogs, attachments, or users, or on any Jira intent without a key ("create/find a ticket", "pick a project"). Auto-triggers on Jira URLs and issue keys (PROJ-123). Also use when MCP Atlassian tools fail or are unavailable for Jira Server/DC.

FileKindSize
AGENTS.mdmarkdown2.5 KB
CLAUDE.mdmarkdown9 B
SKILL.mdskill md10.4 KB
evals/evals.jsonconfig7.6 KB
references/agile.mdmarkdown1.9 KB
references/attachments.mdmarkdown4.7 KB
references/comments.mdmarkdown14.4 KB
references/creation.mdmarkdown4.0 KB
references/fields-and-users.mdmarkdown7.7 KB
references/intent-verbs.mdmarkdown13.5 KB
references/issue-editing.mdmarkdown11.6 KB
references/jql-cookbook.mdmarkdown8.0 KB
references/jql-quick-reference.mdmarkdown6.3 KB
references/links.mdmarkdown7.8 KB
references/multi-profile.mdmarkdown3.9 KB
references/no-editorializing.mdmarkdown2.3 KB
references/qa-gather.mdmarkdown12.1 KB
references/troubleshooting.mdmarkdown12.0 KB
references/versions.mdmarkdown7.7 KB
references/watchers.mdmarkdown3.9 KB
references/worklog.mdmarkdown8.6 KB
scripts/core/jira-attachment.pyexecutablescript21.2 KB
scripts/core/jira-issue.pyexecutablescript50.6 KB
scripts/core/jira-search.pyexecutablescript9.6 KB
scripts/core/jira-setup.pyexecutablescript20.0 KB
scripts/core/jira-validate.pyexecutablescript14.2 KB
scripts/core/jira-worklog.pyexecutablescript15.5 KB
scripts/lib/__init__.pyscript742 B
scripts/lib/changelog.pyscript8.0 KB
scripts/lib/client.pyscript26.4 KB
scripts/lib/config.pyscript15.9 KB
scripts/lib/errors.pyscript1.8 KB
scripts/lib/input.pyscript3.5 KB
scripts/lib/jql.pyscript375 B
scripts/lib/markup.pyscript33.2 KB
scripts/lib/markup_cli.pyscript11.3 KB
scripts/lib/output.pyscript6.9 KB
scripts/lib/preview.pyscript10.0 KB
scripts/lib/render.pyscript1.8 KB
scripts/lib/ticket_state.pyscript13.3 KB
scripts/lib/users.pyscript7.5 KB
scripts/utility/jira-fields.pyexecutablescript11.7 KB
scripts/utility/jira-link.pyexecutablescript42.9 KB
scripts/utility/jira-qa-gather.pyexecutablescript26.3 KB
scripts/utility/jira-user.pyexecutablescript9.3 KB
scripts/utility/jira-watchers.pyexecutablescript9.1 KB
scripts/utility/jira-weblink.pyexecutablescript11.2 KB
scripts/utility/jira-worklog-query.pyexecutablescript27.4 KB
scripts/workflow/jira-board.pyexecutablescript7.0 KB
scripts/workflow/jira-comment.pyexecutablescript19.2 KB
scripts/workflow/jira-create.pyexecutablescript24.3 KB
scripts/workflow/jira-move.pyexecutablescript23.5 KB
scripts/workflow/jira-sprint.pyexecutablescript8.1 KB
scripts/workflow/jira-transition.pyexecutablescript33.7 KB
scripts/workflow/jira-version.pyexecutablescript29.4 KB
scripts/workflow/tempo-account.pyexecutablescript9.1 KB

scripts/workflow/tempo-account.py

View on GitHub
#!/usr/bin/env -S uv run --script
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Netresearch DTT GmbH
# /// script
# requires-python = ">=3.11"
# dependencies = [
#     "atlassian-python-api>=3.41.0,<4",
#     "click>=8.1.0,<9",
# ]
# ///
"""Tempo Accounts (Server/DC) - create customers/accounts and link them to projects.

Tempo Accounts is a Jira plugin (rest/tempo-accounts/1/*), reachable with the
same Jira Personal Access Token this skill already uses elsewhere - no
separate credential. Requires the Tempo "Manage Accounts" permission, which
is independent of plain Jira project permissions.
"""

import sys
from pathlib import Path

# ═══════════════════════════════════════════════════════════════════════════════
# Shared library import (TR1.1.1 - PYTHONPATH approach)
# ═══════════════════════════════════════════════════════════════════════════════
_script_dir = Path(__file__).parent
_lib_path = _script_dir.parent / "lib"
if _lib_path.exists():
    sys.path.insert(0, str(_lib_path.parent))

import click
from lib.client import LazyJiraClient
from lib.output import error, format_output, success, warning

# ═══════════════════════════════════════════════════════════════════════════════
# CLI Definition
# ═══════════════════════════════════════════════════════════════════════════════


@click.group()
@click.option("--json", "output_json", is_flag=True, help="Output as JSON")
@click.option("--quiet", "-q", is_flag=True, help="Minimal output (just the created key/id)")
@click.option("--env-file", type=click.Path(), help="Environment file path")
@click.option("--profile", "-P", help="Jira profile name from ~/.jira/profiles.json")
@click.option("--debug", is_flag=True, help="Show debug information on errors")
@click.pass_context
def cli(ctx, output_json: bool, quiet: bool, env_file: str | None, profile: str | None, debug: bool):
    """Tempo Accounts management.

    Create Tempo customers/accounts and link an account to a Jira project.
    """
    ctx.ensure_object(dict)
    ctx.obj["json"] = output_json
    ctx.obj["quiet"] = quiet
    ctx.obj["debug"] = debug
    ctx.obj["client"] = LazyJiraClient(env_file=env_file, profile=profile)


@cli.group()
def customer():
    """Tempo customer (billing entity) management."""


@customer.command("create")
@click.argument("key")
@click.argument("name")
@click.option("--dry-run", is_flag=True, help="Show what would be created without making changes")
@click.pass_context
def customer_create(ctx, key: str, name: str, dry_run: bool):
    """Create a new Tempo customer.

    KEY: Short, stable customer key (e.g., NEWP)

    NAME: Full customer display name (e.g., "Example Customer GmbH")

    Example:

      tempo-account customer create NEWP "Example Customer GmbH"
    """
    client = ctx.obj["client"]

    if dry_run:
        warning("DRY RUN - No customer will be created")
        print("\nWould create Tempo customer:")
        print(f"  Key: {key}")
        print(f"  Name: {name}")
        return

    try:
        result = client.tempo_account_add_new_customer(key, name)
    except Exception as e:
        if ctx.obj["debug"]:
            raise
        error(f"Failed to create Tempo customer: {e}")
        sys.exit(1)

    if ctx.obj["quiet"]:
        print(key)
    elif ctx.obj["json"]:
        format_output(result, as_json=True)
    else:
        success(f"Created Tempo customer: {name}")
        print(f"  Key: {key}")


@cli.group()
def account():
    """Tempo account (cost-tracking entity) management."""


@account.command("create")
@click.argument("key")
@click.argument("name")
@click.option("--lead", required=True, help="Username of the account lead")
@click.option(
    "--customer-key",
    help="Key of an existing Tempo customer this account belongs to (omit for an account without customer)",
)
@click.option("--category", "category_key", help="Key of the Tempo account category (e.g. OPS)")
@click.option("--dry-run", is_flag=True, help="Show what would be created without making changes")
@click.pass_context
def account_create(
    ctx, key: str, name: str, lead: str, customer_key: str | None, category_key: str | None, dry_run: bool
):
    """Create a new Tempo account.

    KEY: Short, stable account key (e.g., NEWP)

    NAME: Full account display name (e.g., "Example Customer GmbH")

    --customer-key needs an existing Tempo customer (see: tempo-account
    customer create). Without it the account has no customer and is created
    as an open, non-global account.

    Examples:

      tempo-account account create NEWP "Example Customer GmbH" --lead jane.doe --customer-key NEWP

      tempo-account account create OPSNEWP "OPS Example Customer GmbH" --lead jane.doe --category OPS
    """
    client = ctx.obj["client"]

    data = _account_payload(key, name, lead, customer_key, category_key)

    if dry_run:
        warning("DRY RUN - No account will be created")
        print("\nWould create Tempo account:")
        print(f"  Name: {name}")
        _print_account(data)
        return

    try:
        result = client.tempo_account_add_account(data)
    except Exception as e:
        if ctx.obj["debug"]:
            raise
        error(f"Failed to create Tempo account: {e}")
        sys.exit(1)

    if ctx.obj["quiet"]:
        account_id = result.get("id") if isinstance(result, dict) else None
        print(account_id if account_id is not None else key)
    elif ctx.obj["json"]:
        format_output(result, as_json=True)
    else:
        success(f"Created Tempo account: {name}")
        _print_account(data)
        if isinstance(result, dict) and result.get("id") is not None:
            print(f"  Account ID: {result['id']}")
            print("  Note: use this Account ID with 'tempo-account account link' to attach it to a project.")


def _account_payload(key: str, name: str, lead: str, customer_key: str | None, category_key: str | None) -> dict:
    """Build the Tempo account payload. Optional parts are only sent when given."""
    data: dict = {"key": key, "name": name, "lead": {"name": lead}}
    if customer_key:
        data["customer"] = {"key": customer_key}
    else:
        # The payload shape that is known to work on Tempo Server without a customer.
        data["status"] = "OPEN"
        data["global"] = False
    if category_key:
        data["category"] = {"key": category_key}
    return data


def _print_account(data: dict) -> None:
    print(f"  Key: {data['key']}")
    print(f"  Lead: {data['lead']['name']}")
    print(f"  Customer: {data.get('customer', {}).get('key', '-')}")
    if "category" in data:
        print(f"  Category: {data['category']['key']}")


@account.command("link")
@click.argument("account_id", type=int)
@click.argument("project_key")
@click.option("--default", "default_account", is_flag=True, help="Mark this as the project's default account")
@click.option("--dry-run", is_flag=True, help="Show what would be linked without making changes")
@click.pass_context
def account_link(ctx, account_id: int, project_key: str, default_account: bool, dry_run: bool):
    """Link an existing Tempo account to a Jira project.

    ACCOUNT_ID: Numeric Tempo account id (printed by 'account create')

    PROJECT_KEY: Key of the Jira project to link the account to (e.g., NEWP)

    Example:

      tempo-account account link 42 NEWP --default
    """
    client = ctx.obj["client"]

    try:
        project = client.project(project_key)
    except Exception as e:
        error(f"Could not resolve project '{project_key}': {e}")
        sys.exit(1)

    project_id = project.get("id") if isinstance(project, dict) else None
    if not project_id:
        error(f"Project '{project_key}' has no numeric id in the API response")
        sys.exit(1)

    if dry_run:
        warning("DRY RUN - No link will be created")
        print("\nWould link Tempo account to project:")
        print(f"  Account ID: {account_id}")
        print(f"  Project: {project_key} (id={project_id})")
        print(f"  Default account: {default_account}")
        return

    try:
        result = client.tempo_account_associate_with_jira_project(
            account_id, project_id, default_account=default_account
        )
    except Exception as e:
        if ctx.obj["debug"]:
            raise
        error(f"Failed to link Tempo account to project: {e}")
        sys.exit(1)

    if ctx.obj["quiet"]:
        print(project_key)
    elif ctx.obj["json"]:
        format_output(result, as_json=True)
    else:
        success(f"Linked Tempo account {account_id} to project {project_key}")
        if default_account:
            print("  Marked as default account")


if __name__ == "__main__":
    cli()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall