What is the default value of a Boolean Parameter if unchecked?
The default value is false when the checkbox is not checked.
Click to reveal answer
Which Jenkins parameter type lets you enter free text?
AString Parameter
BBoolean Parameter
CChoice Parameter
DFile Parameter
✗ Incorrect
String Parameter allows free text input when starting a job.
What does a Boolean Parameter display in Jenkins?
AA dropdown list
BA file upload
CA text box
DA checkbox
✗ Incorrect
Boolean Parameter shows a checkbox to select true or false.
How do you limit input to specific options in Jenkins parameters?
AUse Choice Parameter
BUse Boolean Parameter
CUse String Parameter
DUse Password Parameter
✗ Incorrect
Choice Parameter restricts input to predefined options.
In a Jenkins pipeline, where do you define parameters?
AInside <code>environment</code> block
BInside <code>parameters</code> block
CInside <code>stages</code> block
DInside <code>steps</code> block
✗ Incorrect
Parameters are defined inside the parameters block.
What is the default value of a Boolean Parameter if not checked?
Atrue
Bnull
Cfalse
Dundefined
✗ Incorrect
Unchecked Boolean Parameter defaults to false.
Explain the differences between String, Boolean, and Choice parameters in Jenkins.
Think about how each parameter type collects input from the user.
You got /3 concepts.
Describe how to define a Boolean parameter in a Jenkins pipeline script.
Look for the syntax inside the parameters block.
You got /3 concepts.
Practice
(1/5)
1. What type of Jenkins parameter should you use if you want the user to enter any text value before running a job?
easy
A. String parameter
B. Boolean parameter
C. Choice parameter
D. File parameter
Solution
Step 1: Understand parameter types
String parameters allow users to input any text value.
Step 2: Match requirement to parameter
Since the question asks for text input, String parameter fits best.
Final Answer:
String parameter -> Option A
Quick Check:
Text input = String parameter [OK]
Hint: Text input? Always pick String parameter [OK]
Common Mistakes:
Choosing Boolean parameter for text input
Confusing Choice parameter with String parameter
Selecting File parameter which is for files
2. Which of the following is the correct syntax to define a Boolean parameter in a Jenkins pipeline script?
easy
A. choice(name: 'DEPLOY', choices: ['true', 'false'], description: 'Deploy to production?')
B. stringParam(name: 'DEPLOY', defaultValue: 'true', description: 'Deploy to production?')
C. booleanParam(name: 'DEPLOY', defaultValue: true, description: 'Deploy to production?')
D. boolParam(name: 'DEPLOY', default: true, desc: 'Deploy to production?')
Solution
Step 1: Recall Jenkins Boolean parameter syntax
The correct syntax uses booleanParam with name, defaultValue, and description keys.
Step 2: Compare options
booleanParam(name: 'DEPLOY', defaultValue: true, description: 'Deploy to production?') matches the correct syntax exactly; others have wrong names or keys.
Final Answer:
booleanParam(name: 'DEPLOY', defaultValue: true, description: 'Deploy to production?') -> Option C
When running the job, Jenkins throws an error. What is the problem?
medium
A. defaultValue should be a boolean, not a string
B. Parameter name cannot be uppercase
C. booleanParam does not accept description
D. Missing choice parameter for boolean
Solution
Step 1: Check booleanParam defaultValue type
defaultValue must be true or false (boolean), not 'false' (string).
Step 2: Identify error cause
Passing string 'false' causes type error in Jenkins pipeline.
Final Answer:
defaultValue should be a boolean, not a string -> Option A
Quick Check:
Boolean defaultValue = true/false, not 'true'/'false' [OK]
Hint: Boolean defaultValue must be true or false, no quotes [OK]
Common Mistakes:
Using string 'false' instead of boolean false
Thinking parameter names must be lowercase
Assuming booleanParam needs choice parameter
5. You want to create a Jenkins job that asks the user to select a deployment region from ['us-east', 'us-west', 'eu-central'], enter a version string, and confirm with a yes/no checkbox before deploying. Which parameter types should you use together?
hard
A. Choice parameter for region, Choice parameter for version, Boolean parameter for confirmation
B. String parameter for region, Boolean parameter for version, Choice parameter for confirmation
C. Boolean parameter for region, Choice parameter for version, String parameter for confirmation
D. Choice parameter for region, String parameter for version, Boolean parameter for confirmation
Solution
Step 1: Match each input to parameter type
Region selection from fixed list -> Choice parameter; version text -> String parameter; yes/no confirm -> Boolean parameter.
Step 2: Verify option matches all three correctly
Choice parameter for region, String parameter for version, Boolean parameter for confirmation correctly assigns Choice, String, and Boolean parameters respectively.
Final Answer:
Choice parameter for region, String parameter for version, Boolean parameter for confirmation -> Option D
Quick Check:
Dropdown = Choice, Text = String, Yes/No = Boolean [OK]