Blog
Wild & Free Tools

Convert JSON to YAML for Jenkins Pipelines and JCasC

Last updated: February 2026 6 min read
Quick Answer

Table of Contents

  1. JCasC expects YAML, not JSON
  2. Pipeline metadata — JSON to YAML for triggers
  3. Credential and secret caveats
  4. Migration from classic XML job configs
  5. Validation before reload
  6. Frequently Asked Questions

Jenkins Configuration-as-Code (JCasC) defines your entire Jenkins instance — credentials, jobs, global settings — in YAML files. If you're generating configs from an automation tool that emits JSON, or converting classic XML job definitions through a JSON intermediate, a browser flip to YAML gets you the config file format JCasC expects. This guide covers the conversion and the JCasC-specific things to review after.

JCasC Expects YAML, Not JSON

JCasC's file format is YAML. A minimal JCasC config:

jenkins:
  systemMessage: "Managed by JCasC"
  numExecutors: 4
  securityRealm:
    local:
      allowsSignup: false

If your source format is JSON (from a generator, export, or API), convert with our browser tool, paste the YAML into jenkins.yaml, mount into your Jenkins container or reference via CASC_JENKINS_CONFIG.

Pipeline Metadata — JSON to YAML for Triggers

Jenkins Pipeline itself is Groovy (a Jenkinsfile). But pipeline metadata — triggers, parameters, multibranch configs — often flows through JSON when generated by external tools. Converting to YAML makes these configs reviewable.

Example: a multibranch pipeline config emitted as JSON from an internal tool. Convert to YAML, check into your JCasC repo under jobs/pipelines.yaml, reference from the main JCasC file.

Sell Custom Apparel — We Handle Printing & Free Shipping

Credential and Secret Caveats

JCasC references secrets using ${...} placeholders that resolve at startup:

credentials:
  system:
    domainCredentials:
      - credentials:
          - usernamePassword:
              scope: GLOBAL
              id: github-token
              username: ci-bot
              password: ${GITHUB_TOKEN}

If your source JSON contains real secret values (not placeholders), don't commit the YAML output. Replace with ${ENV_VAR} references first. Our converter doesn't touch secrets — whatever's in the JSON is in the YAML. See our no-upload privacy guide — the converter runs locally, so secrets don't leave your machine, but you still shouldn't commit them to Git.

Migration From Classic XML Job Configs

Classic Jenkins job configs are XML. Migrating to JCasC is a two-step process:

  1. XML → JSON using an XML-to-JSON converter (our XML-to-JSON tool in reverse, or yq).
  2. JSON → YAML using our converter.

The output won't match JCasC schema exactly — Jenkins XML structure differs from JCasC structure — but it's a starting point for hand-refinement. Faster than writing from scratch.

Validation Before Reload

Before pushing JCasC YAML to a live Jenkins:

YAML is valid doesn't mean JCasC-valid. Validate against the schema Jenkins knows.

Migrate Jenkins Configs to YAML

Paste JSON, click Convert, save as jenkins.yaml. JCasC-ready starting point.

Open Free JSON to YAML Converter

Frequently Asked Questions

Can Jenkins load a JSON configuration file?

JCasC is YAML-only. Jenkins' core XML configs accept XML. There's no official JSON loader — convert to YAML first if your source is JSON.

Will converted YAML work with JCasC's schema validator?

The conversion produces valid YAML. Whether it matches JCasC's schema depends on the source JSON structure. Expect hand-refinement for most inputs.

How do I export an existing Jenkins config to JCasC YAML?

The JCasC plugin has an "Export" button. That produces YAML directly — no conversion needed. Our converter is for the case where your source is JSON from elsewhere.

Can I use this to convert Jenkins Pipeline JSON to a Jenkinsfile?

Pipeline (Jenkinsfile) is Groovy, not YAML. Our converter gets you YAML — you'd still need to hand-write the Groovy pipeline based on the structured config.

Alicia Grant
Alicia Grant Frontend Engineer

Alicia leads image and PDF tool development at WildandFree, specializing in high-performance client-side browser tools.

More articles by Alicia →
Launch Your Own Clothing Brand — No Inventory, No Risk