{ "kind": "open-flow-workflow", "version": 1, "name": "Create or Comment on Jira Issues from Zendesk", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_de6a912392d9d0b7": { "name": "Receive a Zendesk event", "kind": "webhook", "bodyFields": [ { "jsonSchema": { "anyOf": [ { "type": "integer" }, { "type": "string" } ] }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "comment" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "secret" } ], "method": "POST", "options": { "responseData": "{}", "responseHeaders": { "Content-Type": "application/json" }, "responseStatusCode": 200 } }, "n_457b6ae7b1bf11f7": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_de6a912392d9d0b7", "output": "body" } ] }, "secret": { "kind": "unset" }, "fieldId": { "kind": "value", "value": 0 }, "projectId": { "kind": "value", "value": "YOUR_PROJECT_ID" }, "issueTypeId": { "kind": "value", "value": "YOUR_ISSUE_TYPE_ID" } }, "name": "Validate the ticket event", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "secret" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "fieldId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "projectId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "issueTypeId" } ], "outputs": [ { "jsonSchema": { "type": "integer", "minimum": 1 }, "nullable": false, "handle": "ticketId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "comment" }, { "jsonSchema": { "type": "integer", "minimum": 1 }, "nullable": false, "handle": "fieldId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "projectId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "issueTypeId" } ], "name": "Validate the ticket event", "moduleId": "n_6d976f0f9731c87a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_2e4844ac923536dc": { "inputs": { "ticketId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "ticketId" } ] } }, "name": "Read the Zendesk ticket", "kind": "task", "task": { "inputs": [ { "description": "Zendesk ticket identifier.", "jsonSchema": { "type": "integer", "exclusiveMinimum": 0, "description": "Zendesk ticket identifier." }, "nullable": false, "handle": "ticketId" } ], "outputs": [ { "description": "Zendesk ticket details.", "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "Zendesk ticket identifier." }, "url": { "type": [ "string", "null" ], "description": "API URL of the ticket, or null when Zendesk omits it." }, "subject": { "type": [ "string", "null" ], "description": "Ticket subject, or null when Zendesk omits it." }, "description": { "type": [ "string", "null" ], "description": "Ticket description, or null when Zendesk omits it." }, "status": { "type": [ "string", "null" ], "description": "Ticket status, or null when Zendesk omits it." }, "priority": { "type": [ "string", "null" ], "description": "Ticket priority, or null when Zendesk omits it." }, "type": { "type": [ "string", "null" ], "description": "Ticket type, or null when Zendesk omits it." }, "requesterId": { "type": [ "integer", "null" ], "description": "Requester identifier, or null when Zendesk omits it." }, "assigneeId": { "type": [ "integer", "null" ], "description": "Assignee identifier, or null when Zendesk omits it." }, "groupId": { "type": [ "integer", "null" ], "description": "Group identifier, or null when Zendesk omits it." }, "organizationId": { "type": [ "integer", "null" ], "description": "Organization identifier, or null when Zendesk omits it." }, "externalId": { "type": [ "string", "null" ], "description": "External identifier, or null when Zendesk omits it." }, "dueAt": { "type": [ "string", "null" ], "description": "Task due timestamp, or null when Zendesk omits it." }, "createdAt": { "type": [ "string", "null" ], "description": "Ticket creation timestamp, or null when Zendesk omits it." }, "updatedAt": { "type": [ "string", "null" ], "description": "Ticket update timestamp, or null when Zendesk omits it." }, "tags": { "type": "array", "items": { "type": "string", "description": "Tag attached to the ticket." }, "description": "Ticket tags." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Raw Zendesk ticket payload." } }, "required": [ "id", "url", "subject", "description", "requesterId", "assigneeId", "groupId", "organizationId", "externalId", "dueAt", "createdAt", "updatedAt", "tags", "raw" ], "additionalProperties": false, "description": "Zendesk ticket details." }, "nullable": false, "handle": "ticket" }, { "description": "Comments attached to the ticket.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "Zendesk ticket comment identifier." }, "type": { "type": [ "string", "null" ], "description": "Zendesk comment type, or null when Zendesk omits it." }, "authorId": { "type": [ "integer", "null" ], "description": "Identifier of the comment author, or null when Zendesk omits it." }, "body": { "type": [ "string", "null" ], "description": "Plain-text comment body, or null when Zendesk omits it." }, "htmlBody": { "type": [ "string", "null" ], "description": "HTML comment body, or null when Zendesk omits it." }, "plainBody": { "type": [ "string", "null" ], "description": "Zendesk normalized plain-text body, or null when omitted." }, "public": { "type": [ "boolean", "null" ], "description": "Whether the comment is public, or null when Zendesk omits it." }, "createdAt": { "type": [ "string", "null" ], "description": "Comment creation timestamp, or null when Zendesk omits it." }, "attachments": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "Zendesk attachment identifier." }, "fileName": { "type": [ "string", "null" ], "description": "Attachment file name, or null when Zendesk omits it." }, "contentType": { "type": [ "string", "null" ], "description": "Attachment MIME type, or null when Zendesk omits it." }, "size": { "type": [ "integer", "null" ], "description": "Attachment size in bytes, or null when Zendesk omits it." }, "url": { "type": [ "string", "null" ], "description": "Attachment URL, or null when Zendesk omits it." } }, "required": [ "id", "fileName", "contentType", "size", "url" ], "additionalProperties": false, "description": "Attachment returned with this comment." }, "description": "Attachments returned with the comment." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Raw Zendesk comment payload." } }, "required": [ "id", "type", "authorId", "body", "htmlBody", "plainBody", "public", "createdAt", "attachments", "raw" ], "additionalProperties": false, "description": "Comment associated with the requested ticket." }, "description": "Comments attached to the ticket." }, "nullable": false, "handle": "comments" } ], "name": "Read the Zendesk ticket", "executor": { "kind": "connector", "action": "zendesk.get_ticket" } } }, "n_d074eb942bec5eae": { "inputs": { "ticket": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_2e4844ac923536dc", "output": "ticket" } ] }, "ticketId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "ticketId" } ] }, "fieldId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "fieldId" } ] }, "comment": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "comment" } ] } }, "name": "Find the linked issue", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "Zendesk ticket identifier." }, "url": { "type": [ "string", "null" ], "description": "API URL of the ticket, or null when Zendesk omits it." }, "subject": { "type": [ "string", "null" ], "description": "Ticket subject, or null when Zendesk omits it." }, "description": { "type": [ "string", "null" ], "description": "Ticket description, or null when Zendesk omits it." }, "status": { "type": [ "string", "null" ], "description": "Ticket status, or null when Zendesk omits it." }, "priority": { "type": [ "string", "null" ], "description": "Ticket priority, or null when Zendesk omits it." }, "type": { "type": [ "string", "null" ], "description": "Ticket type, or null when Zendesk omits it." }, "requesterId": { "type": [ "integer", "null" ], "description": "Requester identifier, or null when Zendesk omits it." }, "assigneeId": { "type": [ "integer", "null" ], "description": "Assignee identifier, or null when Zendesk omits it." }, "groupId": { "type": [ "integer", "null" ], "description": "Group identifier, or null when Zendesk omits it." }, "organizationId": { "type": [ "integer", "null" ], "description": "Organization identifier, or null when Zendesk omits it." }, "externalId": { "type": [ "string", "null" ], "description": "External identifier, or null when Zendesk omits it." }, "dueAt": { "type": [ "string", "null" ], "description": "Task due timestamp, or null when Zendesk omits it." }, "createdAt": { "type": [ "string", "null" ], "description": "Ticket creation timestamp, or null when Zendesk omits it." }, "updatedAt": { "type": [ "string", "null" ], "description": "Ticket update timestamp, or null when Zendesk omits it." }, "tags": { "type": "array", "items": { "type": "string", "description": "Tag attached to the ticket." }, "description": "Ticket tags." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Raw Zendesk ticket payload." } }, "required": [ "id", "url", "subject", "description", "requesterId", "assigneeId", "groupId", "organizationId", "externalId", "dueAt", "createdAt", "updatedAt", "tags", "raw" ], "additionalProperties": false, "description": "Zendesk ticket details." }, "nullable": false, "handle": "ticket" }, { "jsonSchema": { "type": "integer", "minimum": 1 }, "nullable": false, "handle": "ticketId" }, { "jsonSchema": { "type": "integer", "minimum": 1 }, "nullable": false, "handle": "fieldId" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "comment" } ], "outputs": [ { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "existing" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "key" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "title" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "description" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "comment" } ], "name": "Find the linked issue", "moduleId": "n_969b07ce9bd22e4e", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_65fb4511b6f94ba2": { "inputs": {}, "name": "Issue already linked", "kind": "condition", "matchMode": "first", "cases": [ { "output": "yes", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_d074eb942bec5eae", "output": "existing" } }, "operator": "==", "right": { "kind": "value", "value": true } } ] } ] } ] }, "n_00607395e9ebd267": { "inputs": { "key": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d074eb942bec5eae", "output": "key" } ] }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d074eb942bec5eae", "output": "comment" } ] } }, "name": "Comment on the Jira issue", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "key" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "text" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "The Jira comment ID." }, "self": { "type": "string", "description": "The Jira API URL for this comment." }, "body": { "anyOf": [ { "type": "object", "properties": { "type": { "const": "doc", "description": "The ADF root node type." }, "version": { "type": "integer", "description": "The ADF document version." }, "content": { "type": "array", "items": { "description": "An ADF top-level node." }, "description": "The ADF top-level content nodes." } }, "required": [ "type", "version", "content" ], "additionalProperties": true, "description": "Atlassian Document Format document." }, { "type": "string", "description": "Plain text returned by Jira Server or Data Center." } ], "description": "The Jira comment body in the connected deployment's format." }, "author": { "type": [ "object", "null" ], "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira comment author." }, "updateAuthor": { "type": [ "object", "null" ], "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira comment update author." }, "created": { "type": "string", "description": "The Jira comment creation timestamp." }, "updated": { "type": "string", "description": "The Jira comment update timestamp." }, "jsdPublic": { "type": "boolean", "description": "Whether the Jira comment is public in JSM." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira comment payload." } }, "required": [ "id" ], "additionalProperties": true, "description": "The created Jira comment." }, "nullable": false, "handle": "comment" } ], "name": "Comment on the Jira issue", "moduleId": "n_1fa58d2c2dae937c", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "jira.add_comment" } ] } ] } }, "n_6f4e213f70796177": { "inputs": { "projectId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "projectId" } ] }, "issueTypeId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "issueTypeId" } ] }, "title": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d074eb942bec5eae", "output": "title" } ] }, "description": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d074eb942bec5eae", "output": "description" } ] } }, "name": "Create a Jira issue", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "projectId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "issueTypeId" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "title" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "description" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "The Jira issue ID." }, "key": { "type": "string", "description": "The Jira issue key." }, "self": { "type": "string", "description": "The Jira API URL for this issue." }, "summary": { "type": "string", "description": "The Jira issue summary." }, "description": { "type": "object", "properties": { "type": { "const": "doc", "description": "The ADF root node type." }, "version": { "type": "integer", "description": "The ADF document version." }, "content": { "type": "array", "items": { "description": "An ADF top-level node." }, "description": "The ADF top-level content nodes." } }, "required": [ "type", "version", "content" ], "additionalProperties": true, "description": "The normalized Jira issue description in ADF." }, "status": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira issue status." }, "issueType": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira issue type." }, "project": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira project ID." }, "key": { "type": "string", "description": "The Jira project key." }, "name": { "type": "string", "description": "The Jira project name." }, "self": { "type": "string", "description": "The Jira API URL for this project." }, "description": { "type": "string", "description": "The Jira project description." }, "projectTypeKey": { "type": "string", "description": "The Jira project type key." }, "simplified": { "type": "boolean", "description": "Whether the project uses a simplified workflow." }, "style": { "type": "string", "description": "The Jira project style." }, "url": { "type": "string", "description": "The Jira project URL." }, "lead": { "type": "object", "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira project lead." }, "projectCategory": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira project category." }, "avatarUrls": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Jira avatar URLs keyed by size." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira project payload." } }, "required": [ "id", "key", "name" ], "additionalProperties": true, "description": "The Jira issue project." }, "assignee": { "type": [ "object", "null" ], "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira issue assignee." }, "reporter": { "type": [ "object", "null" ], "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira issue reporter." }, "priority": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira issue priority." }, "labels": { "type": "array", "items": { "type": "string", "description": "A Jira issue label." }, "description": "The Jira issue labels." }, "created": { "type": "string", "description": "The Jira issue creation timestamp." }, "updated": { "type": "string", "description": "The Jira issue update timestamp." }, "dueDate": { "type": [ "string", "null" ], "description": "The Jira issue due date." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira fields payload." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira issue payload." } }, "required": [ "id", "key" ], "additionalProperties": true, "description": "The created Jira issue." }, "nullable": false, "handle": "issue" } ], "name": "Create a Jira issue", "moduleId": "n_571f4bf2cc48d41c", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "jira.create_issue" } ] } ] } }, "n_8d930098e4bc92a8": { "inputs": { "ticketId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "ticketId" } ] }, "fieldId": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_457b6ae7b1bf11f7", "output": "fieldId" } ] }, "issue": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_6f4e213f70796177", "output": "issue" } ] } }, "name": "Link the Zendesk ticket", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "integer", "minimum": 1 }, "nullable": false, "handle": "ticketId" }, { "jsonSchema": { "type": "integer", "minimum": 1 }, "nullable": false, "handle": "fieldId" }, { "jsonSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "The Jira issue ID." }, "key": { "type": "string", "description": "The Jira issue key." }, "self": { "type": "string", "description": "The Jira API URL for this issue." }, "summary": { "type": "string", "description": "The Jira issue summary." }, "description": { "type": "object", "properties": { "type": { "const": "doc", "description": "The ADF root node type." }, "version": { "type": "integer", "description": "The ADF document version." }, "content": { "type": "array", "items": { "description": "An ADF top-level node." }, "description": "The ADF top-level content nodes." } }, "required": [ "type", "version", "content" ], "additionalProperties": true, "description": "The normalized Jira issue description in ADF." }, "status": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira issue status." }, "issueType": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira issue type." }, "project": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira project ID." }, "key": { "type": "string", "description": "The Jira project key." }, "name": { "type": "string", "description": "The Jira project name." }, "self": { "type": "string", "description": "The Jira API URL for this project." }, "description": { "type": "string", "description": "The Jira project description." }, "projectTypeKey": { "type": "string", "description": "The Jira project type key." }, "simplified": { "type": "boolean", "description": "Whether the project uses a simplified workflow." }, "style": { "type": "string", "description": "The Jira project style." }, "url": { "type": "string", "description": "The Jira project URL." }, "lead": { "type": "object", "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira project lead." }, "projectCategory": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira project category." }, "avatarUrls": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Jira avatar URLs keyed by size." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira project payload." } }, "required": [ "id", "key", "name" ], "additionalProperties": true, "description": "The Jira issue project." }, "assignee": { "type": [ "object", "null" ], "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira issue assignee." }, "reporter": { "type": [ "object", "null" ], "properties": { "accountId": { "type": "string", "description": "The Jira account ID." }, "name": { "type": "string", "description": "The Jira Server username." }, "key": { "type": "string", "description": "The Jira Server user key." }, "accountType": { "type": "string", "description": "The Jira account type." }, "displayName": { "type": "string", "description": "The Jira display name." }, "emailAddress": { "type": "string", "description": "The Jira email address when available." }, "active": { "type": "boolean", "description": "Whether the Jira account is active." }, "self": { "type": "string", "description": "The Jira API URL for this user." }, "timeZone": { "type": "string", "description": "The Jira user time zone." } }, "additionalProperties": true, "description": "The Jira issue reporter." }, "priority": { "type": [ "object", "null" ], "properties": { "id": { "type": "string", "description": "The Jira identifier." }, "name": { "type": "string", "description": "The Jira display name." }, "key": { "type": "string", "description": "The Jira key." }, "self": { "type": "string", "description": "The Jira API URL for this object." }, "description": { "type": "string", "description": "The Jira description." } }, "additionalProperties": true, "description": "The Jira issue priority." }, "labels": { "type": "array", "items": { "type": "string", "description": "A Jira issue label." }, "description": "The Jira issue labels." }, "created": { "type": "string", "description": "The Jira issue creation timestamp." }, "updated": { "type": "string", "description": "The Jira issue update timestamp." }, "dueDate": { "type": [ "string", "null" ], "description": "The Jira issue due date." }, "fields": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira fields payload." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "The original Jira issue payload." } }, "required": [ "id", "key" ], "additionalProperties": true, "description": "The created Jira issue." }, "nullable": false, "handle": "issue" } ], "outputs": [ { "jsonSchema": { "type": "object", "properties": { "id": { "type": "integer", "exclusiveMinimum": 0, "description": "Zendesk ticket identifier." }, "url": { "type": [ "string", "null" ], "description": "API URL of the ticket, or null when Zendesk omits it." }, "subject": { "type": [ "string", "null" ], "description": "Ticket subject, or null when Zendesk omits it." }, "description": { "type": [ "string", "null" ], "description": "Ticket description, or null when Zendesk omits it." }, "status": { "type": [ "string", "null" ], "description": "Ticket status, or null when Zendesk omits it." }, "priority": { "type": [ "string", "null" ], "description": "Ticket priority, or null when Zendesk omits it." }, "type": { "type": [ "string", "null" ], "description": "Ticket type, or null when Zendesk omits it." }, "requesterId": { "type": [ "integer", "null" ], "description": "Requester identifier, or null when Zendesk omits it." }, "assigneeId": { "type": [ "integer", "null" ], "description": "Assignee identifier, or null when Zendesk omits it." }, "groupId": { "type": [ "integer", "null" ], "description": "Group identifier, or null when Zendesk omits it." }, "organizationId": { "type": [ "integer", "null" ], "description": "Organization identifier, or null when Zendesk omits it." }, "externalId": { "type": [ "string", "null" ], "description": "External identifier, or null when Zendesk omits it." }, "dueAt": { "type": [ "string", "null" ], "description": "Task due timestamp, or null when Zendesk omits it." }, "createdAt": { "type": [ "string", "null" ], "description": "Ticket creation timestamp, or null when Zendesk omits it." }, "updatedAt": { "type": [ "string", "null" ], "description": "Ticket update timestamp, or null when Zendesk omits it." }, "tags": { "type": "array", "items": { "type": "string", "description": "Tag attached to the ticket." }, "description": "Ticket tags." }, "raw": { "type": "object", "additionalProperties": { "description": "A record value." }, "description": "Raw Zendesk ticket payload." } }, "required": [ "id", "url", "subject", "description", "requesterId", "assigneeId", "groupId", "organizationId", "externalId", "dueAt", "createdAt", "updatedAt", "tags", "raw" ], "additionalProperties": false, "description": "Zendesk ticket returned after the mutation." }, "nullable": false, "handle": "ticket" } ], "name": "Link the Zendesk ticket", "moduleId": "n_66ae3bff6d2a9126", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [ { "action": "zendesk.update_ticket" } ] } ] } } }, "edges": [ { "source": "n_de6a912392d9d0b7", "target": "n_457b6ae7b1bf11f7" }, { "source": "n_457b6ae7b1bf11f7", "target": "n_2e4844ac923536dc" }, { "source": "n_2e4844ac923536dc", "target": "n_d074eb942bec5eae" }, { "source": "n_d074eb942bec5eae", "target": "n_65fb4511b6f94ba2" }, { "source": "n_65fb4511b6f94ba2", "target": "n_00607395e9ebd267", "sourceHandle": "yes" }, { "source": "n_65fb4511b6f94ba2", "target": "n_6f4e213f70796177", "sourceHandle": "otherwise" }, { "source": "n_6f4e213f70796177", "target": "n_8d930098e4bc92a8" } ] } }, "modules": { "n_6d976f0f9731c87a": { "name": "Validate the ticket event", "imports": [], "source": "export default function request({body,secret,fieldId,projectId,issueTypeId}) {\n if(typeof secret!=='string'||secret.length<24||body?.secret!==secret)throw Error('Invalid webhook secret');\n const rawId=body?.id;if(!((typeof rawId==='string'&&/^\\d+$/.test(rawId))||typeof rawId==='number'))throw Error('Invalid ticket ID');const ticketId=Number(rawId);if(!Number.isSafeInteger(ticketId)||ticketId<1)throw Error('Invalid ticket ID');\n if(!Number.isSafeInteger(fieldId)||fieldId<1||!projectId||projectId==='YOUR_PROJECT_ID'||!issueTypeId||issueTypeId==='YOUR_ISSUE_TYPE_ID')throw Error('Configure the custom field, Jira project and issue type');\n const comment=body?.comment;if(comment!=null&&typeof comment!=='string')throw Error('Invalid comment');return {ticketId,comment:comment??'',fieldId,projectId,issueTypeId};\n}\n" }, "n_969b07ce9bd22e4e": { "name": "Find the linked issue", "imports": [], "source": "export default function route({ticket,ticketId,fieldId,comment}) {\n if(ticket?.id!==ticketId||!Array.isArray(ticket?.raw?.custom_fields))throw Error('Ticket ID or custom fields invalid');\n const matches=ticket.raw.custom_fields.filter(x=>x?.id===fieldId);if(matches.length!==1)throw Error('Configured Jira issue field is absent or duplicated');\n const value=matches[0].value;if(value==null||value===''){if(typeof ticket.subject!=='string'||!ticket.subject.trim())throw Error('Ticket subject is missing');const url=typeof ticket.raw.url==='string'?ticket.raw.url.match(/^https:\\/\\/([a-z0-9-]+\\.zendesk\\.com)\\/api\\/v2\\/tickets\\/(\\d+)\\.json$/i):null;if(!url||url[2]!==String(ticketId))throw Error('Invalid Zendesk ticket URL');return {existing:false,key:'-',title:ticket.subject.trim(),description:`See Zendesk issue at: https://${url[1]}/agent/tickets/${ticketId}`,comment:'-'};}\n if(typeof value!=='string'||!value.trim()||value!==value.trim())throw Error('Invalid stored Jira issue key');if(!comment.trim())throw Error('A comment is required for an existing issue');return {existing:true,key:value,title:ticket.subject||'-',description:'-',comment};\n}\n" }, "n_1fa58d2c2dae937c": { "name": "Comment on the Jira issue", "imports": [], "source": "export default async function comment({key,text},context) {return await context.actions.call('jira.add_comment',{issueIdOrKey:key,body:{type:'doc',version:1,content:[{type:'paragraph',content:[{type:'text',text}]}]}});}\n" }, "n_571f4bf2cc48d41c": { "name": "Create a Jira issue", "imports": [], "source": "export default async function create({projectId,issueTypeId,title,description},context) {return await context.actions.call('jira.create_issue',{projectId,issueTypeId,summary:title,descriptionText:description});}\n" }, "n_66ae3bff6d2a9126": { "name": "Link the Zendesk ticket", "imports": [], "source": "export default async function update({ticketId,fieldId,issue},context) {if(typeof issue?.key!=='string'||!issue.key)throw Error('Created Jira issue has no key');return await context.actions.call('zendesk.update_ticket',{ticketId,customFields:[{id:fieldId,value:issue.key}]});}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }