8
n8n 中文网amn8n.com

使用完整技术上下文将 Marker.io 问题自动转换为 ServiceNow 事件

初级

这是一个Ticket Management领域的自动化工作流,包含 5 个节点。主要使用 Code, Webhook, ServiceNow 等节点。 使用完整技术上下文将 Marker.io 问题自动转换为 ServiceNow 事件

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "b8d4a47d3554c1f7fcd3ee16a413d67d707f3769dee6d5380a7d25c6b616c836",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "f88ccfcf-40e8-445f-bd14-e77f7226d878",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        0
      ],
      "webhookId": "0c89174c-6bf6-4dc6-bdd6-1903d8d16baf",
      "parameters": {
        "path": "0c89174c-6bf6-4dc6-bdd6-1903d8d16baf",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "a7fdddc9-4355-4e8b-8add-cb28125c4c41",
      "name": "格式化Marker.io数据",
      "type": "n8n-nodes-base.code",
      "position": [
        220,
        0
      ],
      "parameters": {
        "jsCode": "// Extract data from Marker.io webhook\nconst data = $input.first().json.body.data;\n\n// Format the conversation message\nconst issueTitle = data.title;\nconst issueDescription = data.description ? data.description : 'Not set';\nconst markerId = data.markerId;\nconst priority = data.priority;\nconst issueType = data.issueType.name;\nconst publicUrl = data.publicUrl;\nconst privateUrl = data.privateUrl;\nconst dueDate = data.dueDate;\nconst browser = `${data.browser.name} ${data.browser.version}`;\nconst os = `${data.operatingSystem.family} ${data.operatingSystem.version}`;\nconst website = data.website.url;\nconst contextString = data.contextString;\n\n// Get screenshot URL and add .jpg extension\nlet screenshotUrl = data.screenshotUrl;\nif (screenshotUrl) {\n  // Replace the pattern: \"0?\" with \"0.jpg?\"\n  screenshotUrl = screenshotUrl.replace(/\\/0\\?/, '/0.jpg?');\n}\n\n// Create formatted message body with Marker.io ticket link\nconst titleBody = `${issueTitle}`;\n\n// Create formatted message body with Marker.io ticket link\nconst noteBody = `🐛 **New Issue Reported via Marker.io**\n\n**Issue:** ${issueTitle}\n**ID:** ${markerId}\n**Type:** ${issueType}\n**Priority:** ${priority}\n**Due Date:** ${dueDate ? new Date(dueDate).toLocaleDateString() : 'Not set'}\n\n**Description:**\n${issueDescription}\n\n**Technical Details:**\n• Browser: ${browser}\n• OS: ${os}\n• Website: ${website}\n• Context: ${contextString}\n\n**Marker.io issue:** ${publicUrl}\n\n**Custom Data:**\n${Object.entries(data.customData || {}).map(([key, value]) => `• ${key}: ${value}`).join('\\n')}`;\n\nreturn [{\n  json: {\n    reporterEmail: data.reporter.email,\n    reporterName: data.reporter.name,\n    titleBody: titleBody,\n    nodeBody: noteBody,\n    issueId: data.id,\n    markerId: markerId,\n    priority: priority,\n    issueType: issueType,\n    publicUrl: publicUrl,\n    privateUrl: privateUrl,\n    projectId: data.project.id,\n    screenshotUrl: screenshotUrl\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "aaa5c6c1-1de5-417e-b294-13cd2adb2b3b",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -840,
        -80
      ],
      "parameters": {
        "width": 700,
        "height": 2220,
        "content": "# Marker.io到ServiceNow集成"
      },
      "typeVersion": 1
    },
    {
      "id": "6bc8eb42-948e-423a-9801-3bd6d657f208",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        980
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 1160,
        "content": "## 🚨 故障排除"
      },
      "typeVersion": 1
    },
    {
      "id": "ff7943a8-f52f-4e2e-a466-596bb89c6a25",
      "name": "ServiceNow",
      "type": "n8n-nodes-base.serviceNow",
      "position": [
        440,
        0
      ],
      "parameters": {
        "resource": "incident",
        "operation": "create",
        "authentication": "basicAuth",
        "additionalFields": {
          "caller_id": "",
          "description": "={{ $json.nodeBody }}"
        },
        "short_description": "={{ $json.titleBody }}"
      },
      "credentials": {
        "serviceNowBasicApi": {
          "id": "",
          "name": "ServiceNow Basic Auth account"
        }
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Format Marker.io Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Marker.io Data": {
      "main": [
        [
          {
            "node": "ServiceNow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

初级 - 工单管理

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
初级
节点数量5
分类1
节点类型4
难度说明

适合 n8n 新手,包含 1-5 个节点的简单工作流

作者
Marker.io

Marker.io

@markerio

Marker.io is a visual feedback and bug reporting tool primarily used by web development and design teams. It allows users to capture screenshots, annotate them with comments and drawings, and then send them directly to project management or issue tracking tools like Jira, Trello, GitHub, or Asana.

外部链接
在 n8n.io 查看

分享此工作流