In declarative pipelines, the input step must be wrapped inside a script block to run scripted steps.
Step 2: Check the snippet
The input step is directly inside steps without script, causing a syntax error.
Final Answer:
The input step must be inside a script block in declarative pipeline -> Option C
Quick Check:
Input in declarative needs script block [OK]
Hint: Wrap input step in script block in declarative pipelines [OK]
Common Mistakes:
Placing input step directly in steps without script
Missing quotes around message
Thinking input can't be used in certain stages
5. You want to add a manual approval step in a Jenkins declarative pipeline that asks the user to confirm deployment with a custom message and a timeout of 1 hour. Which snippet correctly implements this?
hard
A. input message: 'Deploy now?', timeout: 3600
B. script { input message: 'Deploy now?', timeout: 3600 }