How to correctly populate Type field for new Jira Ticket when Model is dynamically creating the ticket?

Describe the problem/error/question

I am able to easily create and update Jira tickets in automations. But I want to use a Chat agent with a Tools interface to cut a ticket when necessary. If I manually set the ticket type, the agent can create a ticket. But if I set it up for the model to set the type, it fails. The model is passing “Story” or “Task”, and these are not being accepted. I’m wondering if these are enum values and relate to 0,1,2, etc…?

What is the error message (if any)?

Input is:

[

{

“Issue_Type”: “Story”,

“Summary”: “General Story Task”,

“Description”: “This is a general story task created for testing purposes.”

}

]

Error is:

{ "message": "ERROR: Issue Type parameter's value is invalid. This is likely because the URL entered is incorrect", "timestamp": 1743872325188, "name": "WorkflowOperationError", "context": {} }

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi, can you please share your full interactive workflow? If you can do it manually with a certain type, you know what needs to be filled and you can instruct your agent to only chose between these.

regards,
J.

Thanks. I figured it out. The issue is that the interface to Jira wants the ID of the Project and the ID of the issue type. I queried Jira via their REST API and got all of my projects and each of their respective issue types. My python code to do this is below. Then I used each of these mappings in the n8n dialog “description” for each of the Project and Issue Type fields. I told the model to use the numeric value.

import requests
import json

JIRA_URL = "https://name.atlassian.net"
JIRA_EMAIL = "[email protected]"
JIRA_API_TOKEN = "AT...SomeLongString"


auth = (JIRA_EMAIL, JIRA_API_TOKEN)
headers = {"Accept": "application/json"}

project_issue_types = {}
project_ids = {}

# Step 1: Get all projects
projects = requests.get(f"{JIRA_URL}/rest/api/3/project", auth=auth, headers=headers).json()

for project in projects:
    project_name = project["name"]
    project_id = project["id"]
    project_ids[project_name] = project_id

    # Step 2: Get issue types for this project
    r = requests.get(
        f"{JIRA_URL}/rest/api/3/issuetype/project",
        headers=headers,
        auth=auth,
        params={"projectId": project_id}
    )

    if r.status_code != 200:
        print(f"⚠️ Failed to fetch issue types for {project_name}")
        continue

    try:
        issue_types_list = r.json()
        issue_map = {item["name"]: item["id"] for item in issue_types_list}
        project_issue_types[project_name] = issue_map
    except Exception as e:
        print(f"⚠️ Error parsing issue types for {project_name}: {e}")
        continue

# Save both mappings
print("🔑 Project Name → Project ID:")
print(json.dumps(project_ids, indent=2))

print("\n🧩 Project → Issue Types → IDs:")
print(json.dumps(project_issue_types, indent=2))

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.