Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 42 additions & 5 deletions docs/examples/connectors/jira_create_issue/fixture.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
{
"id": "10042",
"key": "PROJ-123",
"self": "https://your-domain.atlassian.net/rest/api/3/issue/10042",
"fields": {
"project": {
"key": "OPS"
"summary": "Bug report",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Details"
}
]
}
]
},
"summary": "ServiceNow INC0010023 \u2014 Email gateway unreachable",
"issuetype": {
"name": "Task"
"id": "10001",
"name": "Bug",
"subtask": false
},
"project": {
"id": "10000",
"key": "PROJ",
"name": "Project Name"
},
"priority": {
"id": "2",
"name": "High"
},
"status": {
"id": "1",
"name": "To Do"
},
"created": "2026-11-23T12:00:00.000+0000",
"updated": "2026-11-23T12:00:00.000+0000",
"reporter": {
"accountId": "5b10a2844c20165700ede21g",
"displayName": "Test User",
"emailAddress": "test@example.com"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
# connector: jira_create_issue — create a Jira issue (Cloud REST API v3).
# A flow emits an issue body ({fields: {project, summary, issuetype, ...}}) on SUBJECT.
# connector: jira_create_issue — Create Jira issues
# Consumes vx.jira.issues.create and creates issues in Jira projects
# Expected payload: {project: "PROJ", summary: "Bug report", description: "Details", issuetype: "Bug", priority: "High"}
# Auth: Jira API token or OAuth 2.0 via secret
# Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post
# Rate limits: Jira Cloud supports 10 requests/s per user (can be increased)
# Secrets: jira/url, jira/email, jira/api_token

driver "http-out"
SUBJECT = "vx.jira.create"
URL = "https://YOURSITE.atlassian.net/rest/api/3/issue"
HEADERS = {"Authorization": f"Basic {secret("jira/basic")}", "Content-Type": "application/json", "Accept": "application/json"}
TEST_BODY = {"fields": {"project": {"key": "OPS"}, "summary": "Vejas connector test", "issuetype": {"name": "Task"}}}
SUBJECT = "vx.jira.issues.create"
URL = f"{secret('jira/url')}/rest/api/3/issue"
METHOD = "POST"
HEADERS = {
"Authorization": f"Basic {secret('jira/basic_auth')}",
"Accept": "application/json",
"Content-Type": "application/json"
}

# Note: Basic auth = base64(email:api_token)
# Store the pre-encoded value in secret('jira/basic_auth')
# Supports custom fields, components, labels, assignee, etc.
68 changes: 56 additions & 12 deletions docs/examples/connectors/jira_create_issue/mock.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@
// Admission mock for jira_create_issue — a minimal local stand-in for the remote API.
// Usage: node mock.mjs <port>. GET /__count returns how many real calls landed.
// Admission mock for jira_create_issue.
import { createServer } from 'node:http';
const port = Number(process.argv[2] || 9200);
const port = Number(process.argv[2] || 9212);
let count = 0;
const GET_BODY = null;
const POST_BODY = {"id": "10001", "key": "OPS-101", "self": "http://127.0.0.1/rest/api/3/issue/10001"};

const POST_BODY = {
"id": "10042",
"key": "PROJ-123",
"self": "https://your-domain.atlassian.net/rest/api/3/issue/10042",
"fields": {
"summary": "Bug report",
"description": {
"type": "doc",
"version": 1,
"content": [{"type": "paragraph", "content": [{"type": "text", "text": "Details"}]}]
},
"issuetype": {"id": "10001", "name": "Bug", "subtask": false},
"project": {"id": "10000", "key": "PROJ", "name": "Project Name"},
"priority": {"id": "2", "name": "High"},
"status": {"id": "1", "name": "To Do"},
"created": "2026-11-23T12:00:00.000+0000",
"updated": "2026-11-23T12:00:00.000+0000",
"reporter": {
"accountId": "5b10a2844c20165700ede21g",
"displayName": "Test User",
"emailAddress": "test@example.com"
}
}
};

createServer((req, res) => {
if (req.url === '/__count') { res.writeHead(200); res.end(String(count)); return; }
let b = ''; req.on('data', c => b += c);
if (req.url === '/__count') {
res.writeHead(200);
res.end(String(count));
return;
}

let body = '';
req.on('data', chunk => body += chunk);
req.on('end', () => {
count++;
const body = req.method === 'POST' ? POST_BODY : GET_BODY;
if (body === null) { res.writeHead(405); res.end(); return; }
res.writeHead(req.method === 'POST' ? 201 : 200, {'content-type':'application/json'});
res.end(JSON.stringify(body));

// Jira Issues API
if (req.method === 'POST' && req.url.includes('/issue')) {
const auth = req.headers['authorization'];
if (!auth || !auth.startsWith('Basic ')) {
res.writeHead(401, {'content-type': 'application/json'});
res.end(JSON.stringify({
errorMessages: ["You do not have the permission to see the specified issue."],
errors: {}
}));
return;
}

res.writeHead(201, {'content-type': 'application/json'});
res.end(JSON.stringify(POST_BODY));
} else {
res.writeHead(405, {'content-type': 'application/json'});
res.end(JSON.stringify({errorMessages: ['Method not allowed']}));
}
});
}).listen(port, '127.0.0.1', () => console.log('READY', port));
}).listen(port, '127.0.0.1', () => console.log('READY', port));
11 changes: 4 additions & 7 deletions docs/examples/connectors/jira_create_issue/overrides.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"literals": {
"URL": "http://127.0.0.1:{PORT}/rest/api/3/issue"
},
"secrets": {
"jira/basic": "ZHVtbXk6ZHVtbXk="
}
}
"URL": "http://127.0.0.1:9212/rest/api/3/issue",
"VEJAS_SECRET_JIRA_URL": "http://127.0.0.1:9212",
"VEJAS_SECRET_JIRA_BASIC_AUTH": "dGVzdEBleGFtcGxlLmNvbTp0ZXN0X2FwaV90b2tlbg=="
}
Loading