How to Connect Jira Service Management (Cloud) with N8N.

In this comprehensive tutorial, you’ll learn how to harness the power of n8n, a powerful workflow automation platform, to connect with Jira Service Management and fully automate this process. We’ll build a workflow that triggers on a new Jira issue, extracts the customer’s details, and automatically creates and assigns them in Jira—all without a single manual click.

What You’ll Learn & Why It Matters

By the end of this guide, you will have a fully functional automation that:

  • Listens for new issues in your Jira Service Management project.
  • Extracts key information like name, email, and website from the issue description.
  • Automatically creates a new customer record in Jira via an API call.
  • Assigns the issue to the newly created customer.

Why use n8n over Jira’s built-in automation? While Jira has powerful automation tools, they often require learning Jira Query Language (JQL) and can be complex for advanced logic. n8n provides a intuitive, visual drag-and-drop interface that makes building sophisticated, cross-app automations much easier.

Prerequisites

Before you begin, ensure you have the following:

  1. An n8n instance. If you don’t have one set up, follow our guide on How to Install n8n on Google Cloud for Free.
  2. Admin access to a Jira Service Management Cloud instance.
  3. Basic familiarity with navigating both n8n and Jira.

Step 1: Generate Your Jira API Token

The connection between n8n and Jira is secured using an API token.

  1. Log in to your Jira Cloud instance.
  2. Click on your profile picture in the bottom left and select Account settings.
  3. Navigate to the Security tab.
  4. Find the section called Create and manage API tokens and click it.
  5. Click the Create API token button.
  6. Give your token a descriptive name (e.g., “n8n Automation”) and click Create.
  7. Crucial: Copy the generated token immediately and store it somewhere safe. You will not be able to see it again.
Jira API Token generation screen

Step 2: Connect Jira to n8n

Now, let’s establish the connection inside n8n.

  1. Open your n8n editor and create a new workflow.
  2. Add your first node. Search for and select the Jira Trigger node.
  3. Click on the dropdown next to “Credentials” and select Create New.
  4. A configuration window will appear. Fill it out as follows:
    • Credential Type: Make sure Jira Cloud API is selected.
    • Email: Enter the email address of your Jira admin user.
    • API Token: Paste the API token you generated in Step 1.
    • Domain: Enter your Jira cloud URL (e.g., https://your-domain.atlassian.net). Remember to remove any trailing slash.
  5. Click Save to create the credential.
n8n Jira credential configuration window

Step 3: Test the Connection

  1. Back in the Jira Trigger node, select your newly created credential from the dropdown.
  2. For the Event, ensure Issue Created is selected.
  3. Click on Execute Node to test the connection.
  4. If configured correctly, n8n will now listen for new issues. Go to your Jira project and create a new test issue.
  5. Once the issue is created, return to n8n. You should see the test issue data appear in the output of your trigger node, confirming the connection is successful.

Step 4: Building the Full Automation Workflow

The trigger is just the start. Here’s a breakdown of the complete workflow logic:

  1. Jira Trigger: The starting point, listening for new issues.
  2. If Condition Node: This node filters the incoming issues. For example, you can set it to only proceed if the issue comes from a specific email address (like your website’s helpdesk alias) or a specific project. This prevents the automation from running on irrelevant issues.
  3. Code Node: This node is where the magic happens. It takes the issue description from the trigger and uses JavaScript to parse and extract specific data—like the customer’s name, email address, and website URL—using regex or string splitting.
  4. HTTP Request Node (Create Customer): This node makes a POST request to Jira’s REST API (/rest/servicedeskapi/customer) to create a new customer. You will use the data extracted in the previous step (e.g., {{ $json.email }} and {{ $json.name }}) in the request body.
  5. HTTP Request Node (Assign Customer): A final API call to assign the newly created issue to the new customer you just created.

Pro Tip: While n8n has native nodes for Jira, the ability to create customers isn’t available yet. Using the HTTP Request node gives you direct access to Jira’s full API, unlocking endless automation possibilities.

Step 5: Download and Use The Free Workflow

{
  "name": "JIRA Customer Auto Assign",
  "nodes": [
    {
      "parameters": {
        "events": [
          "jira:issue_created"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.jiraTrigger",
      "typeVersion": 1.1,
      "position": [
        -272,
        48
      ],
      "id": "52e10d8f-5358-4994-a5e5-421d8cb0a49f",
      "name": "Jira Trigger",
      "webhookId": "ac3e844e-b8a9-4242-99c7-02509f6eeaf9",
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "XDrfdyf2bZlZ7ADe",
          "name": "Jira SW Cloud account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f1a6f3aa-5e68-466b-8ebd-6b30b5624a2e",
              "leftValue": "={{ $json.user.displayName }}",
              "rightValue": "noreply@websensepro.com",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -48,
        48
      ],
      "id": "fed27244-4056-4e54-b4dc-0fc8ec9b543a",
      "name": "If"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e9f0d4c3-b15f-4553-9c98-74fc97e9bfe1",
              "name": "description",
              "value": "={{ $json.issue.fields.description }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        176,
        -48
      ],
      "id": "a8c24097-8982-4354-ae2f-4511d97f8b4e",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "jsCode": "const inputText = $input.first().json.description;\n\n// Regular expressions to find the name, email, and website URL\nconst nameRegex = /Name: (.*)/;\nconst emailRegex = /Email: (.*)/;\nconst websiteUrlRegex = /Website URL: (.*)/;\n\n// Execute the regular expressions on the input text\nconst nameMatch = inputText.match(nameRegex);\nconst emailMatch = inputText.match(emailRegex);\nconst websiteUrlMatch = inputText.match(websiteUrlRegex);\n\n// Extract the captured groups (the actual data)\n// and assign them to the respective variables\nconst name = nameMatch ? nameMatch[1].trim() : null;\nconst email = emailMatch ? emailMatch[1].trim() : null;\nconst websiteUrl = websiteUrlMatch ? websiteUrlMatch[1].trim() : null;\n\n// Return the variables so they can be used in the next nodes\nreturn {\n  name,\n  email,\n  websiteUrl\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        400,
        -48
      ],
      "id": "29b21e44-fcf9-4866-a8a7-7d329be9e51d",
      "name": "Code"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://websensepro.atlassian.net/rest/servicedeskapi/customer",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "jiraSoftwareCloudApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "displayName",
              "value": "={{ $json.name }}"
            },
            {
              "name": "email",
              "value": "={{ $json.email }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        624,
        -48
      ],
      "id": "0f283326-79fd-467b-a819-1210a53b99d5",
      "name": "HTTP Request",
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "XDrfdyf2bZlZ7ADe",
          "name": "Jira SW Cloud account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "issueKey": "={{ $('Jira Trigger').item.json.issue.key }}",
        "updateFields": {
          "reporter": {
            "__rl": true,
            "value": "={{ $json.accountId }}",
            "mode": "id"
          }
        }
      },
      "type": "n8n-nodes-base.jira",
      "typeVersion": 1,
      "position": [
        848,
        -48
      ],
      "id": "28420fc1-ad85-4a1c-b46b-464f35dc707f",
      "name": "Jira Software",
      "credentials": {
        "jiraSoftwareCloudApi": {
          "id": "XDrfdyf2bZlZ7ADe",
          "name": "Jira SW Cloud account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Jira Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Jira Software",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "20586490-a7eb-4b07-8953-2bd2014b4d26",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "d4624db7a3a7e9da97f0a286f3b55ac8518307cf24e917b7a02124c1506facab"
  },
  "id": "Sazs9eHVMIHMnmIm",
  "tags": []
}
  1. In your n8n workflow editor, click the menu button and select Import from URL.
  2. Paste the download link or upload the JSON file.
  3. The workflow will appear. Remember to update the credentials to use your own Jira API token and domain.

Conclusion and Next Steps

You’ve now successfully connected Jira Service Management to n8n and automated a critical business process. This is just one example of what’s possible when you integrate your helpdesk with a powerful automation tool like n8n.

Ready to explore more?

  • Subscribe to our YouTube Channel: For more free tutorials on n8n, lead generation, and AI automation. Watch the full video tutorial for this guide here.
  • Browse our n8n Playlist: We have workflows for LinkedIn automation, scraping emails from Google Maps, and social media management.

Need a custom automation built for your business? Our team can help you design and implement bespoke workflows tailored to your unique needs. Get a free consultation and quote here.


5/5 - (5 votes)

About

Leave a Comment

Your email address will not be published. Required fields are marked *