Convert JSON to YAML for Jenkins Pipelines and JCasC
- Jenkins Configuration-as-Code (JCasC) uses YAML — if you export or generate JSON, you need to flip formats before committing.
- Pipeline definitions are typically Groovy, but metadata and triggers often flow through JSON from orchestration tools.
- Our browser converter gets you the YAML in seconds; JCasC specifics (credential references, secrets) need hand-review after.
Table of Contents
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.
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:
- XML → JSON using an XML-to-JSON converter (our XML-to-JSON tool in reverse, or
yq). - 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:
- Use the JCasC plugin's "Validate Configuration" button in Manage Jenkins.
- Or run
jenkins-config-validatorlocally against your YAML. - Or test in a disposable Jenkins Docker container first.
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 ConverterFrequently 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.

