Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: JIRA ticket integration in task creation and agent cards

Adam Eivye7a75291a990
diff --git a/.changelog/v0.14.x.md b/.changelog/v0.14.x.md
index 606d2e9496..00185a03bc 100644
--- a/.changelog/v0.14.x.md
+++ b/.changelog/v0.14.x.md
@@ -52,6 +52,13 @@ This release adds Ghostty terminal theme integration and a project update workfl
- **`boardId` field on app JIRA config** — new field in the app edit modal and validation schema so sprint lookup can be driven by app config instead of hardcoded values
- **`scripts/jira-create-ticket.js` CLI** — standalone script that imports JIRA services directly, reads app config, auto-resolves the active sprint, and creates tickets with all fields (project, assignee, sprint, epic, story points, labels) in one call; used by the `/ticket` Claude Code skill
+### JIRA Integration in Task & Agent UI
+- **"Create JIRA ticket" checkbox on task creation** — when the selected app has JIRA enabled, a checkbox auto-appears and defaults to checked; the flag flows through to task metadata for downstream ticket creation
+- **JIRA ticket badge on agent cards** — running and completed agents display a linked JIRA ticket ID badge when a ticket was created, with a direct link to the ticket in JIRA
+
+### Git Service: Branch & PR Helpers
+- **`createBranch` / `checkout` / `createPR`** — new git service functions for programmatic branch creation, switching, and GitHub PR creation via `gh` CLI; enables agents to open PRs as part of their workflow
+
## Fixes
- **Disabled GLSL custom shaders** — fragment shaders (bloom, nebula, rain, etc.) ran per-pixel every frame causing GPU-bound lag on terminal output; themes now use color palettes only
diff --git a/client/src/components/cos/tabs/AgentCard.jsx b/client/src/components/cos/tabs/AgentCard.jsx
index 78d738fb4a..5e7c006305 100644
--- a/client/src/components/cos/tabs/AgentCard.jsx
+++ b/client/src/components/cos/tabs/AgentCard.jsx
@@ -12,7 +12,8 @@ import {
Brain,
ThumbsUp,
ThumbsDown,
- MessageSquare
+ MessageSquare,
+ ExternalLink
} from 'lucide-react';
import * as api from '../../../services/api';
import MarkdownOutput from '../MarkdownOutput';
@@ -407,6 +408,27 @@ export default function AgentCard({ agent, onKill, onDelete, onResume, completed
</div>
<p className="text-white text-sm mb-2">{agent.metadata?.taskDescription || agent.taskId}</p>
+ {/* JIRA ticket info */}
+ {agent.metadata?.jiraTicketId && (
+ <div className="flex items-center gap-2 mb-2">
+ <span className="px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded font-mono">
+ {agent.metadata.jiraTicketId}
+ </span>
+ {agent.metadata?.jiraTicketUrl && (
+ <a
+ href={agent.metadata.jiraTicketUrl}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex items-center gap-1 text-xs text-blue-400 hover:text-blue-300 transition-colors"
+ title="Open JIRA ticket in new tab"
+ >
+ View ticket
+ <ExternalLink size={12} aria-hidden="true" />
+ </a>
+ )}
+ </div>
+ )}
+
{/* Live activity feed for running agents */}
{!completed && recentActivity.length > 0 && (
<div className="text-xs font-mono bg-port-bg/50 px-2 py-1.5 rounded space-y-0.5">
diff --git a/client/src/components/cos/tabs/TasksTab.jsx b/client/src/components/cos/tabs/TasksTab.jsx
index b278bdb5a5..ad9d6c204c 100644
--- a/client/src/components/cos/tabs/TasksTab.jsx
+++ b/client/src/components/cos/tabs/TasksTab.jsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
-import { Plus, Play, Image, X, ChevronDown, ChevronRight, Sparkles, Loader2, Paperclip, FileText, Zap, Bookmark } from 'lucide-react';
+import { Plus, Play, Image, X, ChevronDown, ChevronRight, Sparkles, Loader2, Paperclip, FileText, Zap, Bookmark, Ticket } from 'lucide-react';
import toast from 'react-hot-toast';
import {
DndContext,
@@ -34,6 +34,7 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
const [isEnhancing, setIsEnhancing] = useState(false);
const [templates, setTemplates] = useState([]);
const [showTemplates, setShowTemplates] = useState(true);
+ const [createJiraTicket, setCreateJiraTicket] = useState(false);
const fileInputRef = useRef(null);
const attachmentInputRef = useRef(null);
@@ -139,6 +140,18 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
[providers]
);
+ // Check if selected app has JIRA configured
+ const selectedApp = useMemo(() =>
+ apps?.find(a => a.id === newTask.app),
+ [apps, newTask.app]
+ );
+ const appHasJira = selectedApp?.jira?.enabled;
+
+ // Auto-toggle JIRA checkbox when app selection changes
+ useEffect(() => {
+ setCreateJiraTicket(!!apps?.find(a => a.id === newTask.app)?.jira?.enabled);
+ }, [newTask.app, apps]);
+
// Split user tasks by status (only pending tasks are sortable)
const pendingUserTasksLocal = useMemo(() =>
userTasksLocal.filter(t => t.status === 'pending'),
@@ -271,6 +284,7 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
model: newTask.model || undefined,
provider: newTask.provider || undefined,
app: newTask.app || undefined,
+ createJiraTicket: createJiraTicket || undefined,
screenshots: screenshots.length > 0 ? screenshots.map(s => s.path) : undefined,
attachments: attachments.length > 0 ? attachments.map(a => ({
filename: a.filename,
@@ -291,6 +305,7 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
setAttachments([]);
setAddToTop(false);
setEnhancePrompt(false);
+ setCreateJiraTicket(false);
onRefresh();
};
@@ -416,7 +431,7 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
className="w-full px-3 py-2 bg-port-bg border border-port-border rounded-lg text-white text-sm"
/>
</div>
- <div className="flex gap-3">
+ <div className="flex gap-3 items-center">
<div className="flex-1">
<label htmlFor="task-app" className="sr-only">Target application</label>
<select
@@ -431,6 +446,20 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
))}
</select>
</div>
+ {appHasJira && (
+ <label className="flex items-center gap-2 cursor-pointer select-none whitespace-nowrap">
+ <input
+ type="checkbox"
+ checked={createJiraTicket}
+ onChange={(e) => setCreateJiraTicket(e.target.checked)}
+ className="w-4 h-4 rounded border-port-border bg-port-bg text-port-accent focus:ring-port-accent focus:ring-offset-0"
+ />
+ <span className="flex items-center gap-1.5 text-sm text-gray-400">
+ <Ticket size={14} className="text-blue-400" />
+ Create JIRA ticket
+ </span>
+ </label>
+ )}
</div>
<div className="flex gap-3">
<div>
diff --git a/server/routes/cos.js b/server/routes/cos.js
index 022c274ad4..146a49476c 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -114,13 +114,13 @@ router.post('/tasks/enhance', asyncHandler(async (req, res) => {
// POST /api/cos/tasks - Add a new task
router.post('/tasks', asyncHandler(async (req, res) => {
- const { description, priority, context, model, provider, app, type = 'user', approvalRequired, screenshots, attachments, position = 'bottom' } = req.body;
+ const { description, priority, context, model, provider, app, type = 'user', approvalRequired, screenshots, attachments, position = 'bottom', createJiraTicket, jiraTicketId, jiraTicketUrl } = req.body;
if (!description) {
throw new ServerError('Description is required', { status: 400, code: 'VALIDATION_ERROR' });
}
- const taskData = { description, priority, context, model, provider, app, approvalRequired, screenshots, attachments, position };
+ const taskData = { description, priority, context, model, provider, app, approvalRequired, screenshots, attachments, position, createJiraTicket, jiraTicketId, jiraTicketUrl };
const result = await cos.addTask(taskData, type);
res.json(result);
}));
diff --git a/server/services/apps.js b/server/services/apps.js
index 8021910514..999ac9e622 100644
--- a/server/services/apps.js
+++ b/server/services/apps.js
@@ -129,6 +129,7 @@ export async function createApp(appData) {
icon: appData.icon || null,
editorCommand: appData.editorCommand || 'code .',
archived: false,
+ jira: appData.jira || null,
createdAt: now,
updatedAt: now
};
diff --git a/server/services/cos.js b/server/services/cos.js
index 3d61a878ad..64991908c1 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -2884,6 +2884,9 @@ export async function addTask(taskData, taskType = 'user') {
if (taskData.model) metadata.model = taskData.model;
if (taskData.provider) metadata.provider = taskData.provider;
if (taskData.app) metadata.app = taskData.app;
+ if (taskData.createJiraTicket) metadata.createJiraTicket = true;
+ if (taskData.jiraTicketId) metadata.jiraTicketId = taskData.jiraTicketId;
+ if (taskData.jiraTicketUrl) metadata.jiraTicketUrl = taskData.jiraTicketUrl;
if (taskData.screenshots?.length > 0) metadata.screenshots = taskData.screenshots;
if (taskData.attachments?.length > 0) metadata.attachments = taskData.attachments;
diff --git a/server/services/git.js b/server/services/git.js
index 80c439f526..f0c2af49b4 100644
--- a/server/services/git.js
+++ b/server/services/git.js
@@ -309,6 +309,59 @@ export async function push(dir, branch = null) {
return { success: true, output: result.stdout + result.stderr };
}
+/**
+ * Create and switch to a new branch
+ */
+export async function createBranch(dir, branchName) {
+ await execGit(['checkout', '-b', branchName], dir);
+ return { success: true, branch: branchName };
+}
+
+/**
+ * Switch to an existing branch
+ */
+export async function checkout(dir, branchName) {
+ await execGit(['checkout', branchName], dir);
+ return { success: true, branch: branchName };
+}
+
+/**
+ * Create a pull request using the `gh` CLI.
+ * Fails gracefully if `gh` is not installed.
+ * @param {string} dir - Working directory (repo root)
+ * @param {object} options - PR options
+ * @param {string} options.title - PR title
+ * @param {string} options.body - PR description
+ * @param {string} options.base - Base branch (target)
+ * @param {string} options.head - Head branch (source)
+ * @returns {Promise<{success: boolean, url?: string, error?: string}>}
+ */
+export async function createPR(dir, { title, body, base, head }) {
+ return new Promise((resolve) => {
+ const args = ['pr', 'create', '--title', title, '--body', body || '', '--base', base, '--head', head];
+ const child = spawn('gh', args, { cwd: dir, shell: false });
+
+ let stdout = '';
+ let stderr = '';
+
+ child.stdout.on('data', (data) => { stdout += data.toString(); });
+ child.stderr.on('data', (data) => { stderr += data.toString(); });
+
+ child.on('close', (code) => {
+ if (code === 0) {
+ const url = stdout.trim();
+ resolve({ success: true, url });
+ } else {
+ resolve({ success: false, error: stderr || `gh exited with code ${code}` });
+ }
+ });
+
+ child.on('error', (err) => {
+ resolve({ success: false, error: `gh not available: ${err.message}` });
+ });
+ });
+}
+
/**
* Detect base and dev branches from local branch list
* @returns {{ baseBranch: string|null, devBranch: string|null }}