zeroclaw-labs/zeroclaw · error

create_ticket requires a non-empty issue_type

Error message

create_ticket requires a non-empty issue_type

What it means

Client-side guard in create_ticket: after the summary check passes, an empty or whitespace-only issue_type aborts the call before any HTTP request. The issue_type is sent as {"issuetype":{"name":...}} in the create payload, so an empty name could never match a real type. Purely an input-validation error.

Source

Thrown at crates/zeroclaw-tools/src/jira_tool.rs:851

    }

    #[allow(clippy::too_many_arguments)]
    async fn create_ticket(
        &self,
        project_key: &str,
        issue_type: &str,
        summary: &str,
        description: Option<&str>,
        assignee: Option<&str>,
        labels: Option<&[String]>,
        parent_key: Option<&str>,
    ) -> anyhow::Result<ToolResult> {
        validate_project_key(project_key)?;
        if summary.trim().is_empty() {
            anyhow::bail!("create_ticket requires a non-empty summary");
        }
        if issue_type.trim().is_empty() {
            anyhow::bail!("create_ticket requires a non-empty issue_type");
        }
        if let Some(parent) = parent_key {
            validate_issue_key(parent)?;
        }

        let mut fields = serde_json::Map::new();
        fields.insert("project".into(), json!({ "key": project_key }));
        fields.insert("issuetype".into(), json!({ "name": issue_type }));
        fields.insert("summary".into(), json!(summary));

        if let Some(desc) = description {
            let value = if self.is_cloud() {
                build_adf(desc, &HashMap::new())
            } else {
                json!(desc)
            };
            fields.insert("description".into(), value);
        }

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Pass a real issue type name that exists in the target project (Task, Bug, Story, Epic, or a custom type).
  2. Verify the exact spelling of custom issue types via the project's create-metadata in Jira UI or API.
  3. Default to "Task" when the caller has no explicit type, or validate earlier in your layer.

Example fix

// before
jira.create_ticket("PROJ", "", "Fix login crash", None, None, None, None).await?; // -> error

// after
jira.create_ticket("PROJ", "Bug", "Fix login crash", None, None, None, None).await?;
Defensive patterns

Strategy: validation

Validate before calling

let issue_type = issue_type.trim();
if issue_type.is_empty() {
    anyhow::bail!("issue_type required; valid types for this project: Task, Bug, Story");
}
jira.create_ticket("PROJ", issue_type, summary, None, None, None, None).await?;

Prevention

When it happens

Trigger: Calling create_ticket with issue_type="" or " "; passing a user-provided category that is blank; wrappers defaulting a missing JSON field to an empty string instead of falling back to a sensible default like "Task".

Common situations: Configuration files mapping ticket kinds to Jira issue types with a missing/blank entry; LLM tool calls omitting issue_type; environments where the intended type name differs ("Bug" vs "Incident") and the caller sends nothing rather than guessing.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/bbd0b205404d0168. Report an issue: GitHub.