Class AskInteractiveStep
- All Implemented Interfaces:
ExtensionPoint,Describable<org.jenkinsci.plugins.workflow.steps.Step>,Serializable
askInteractive pipeline step (§6.1): a durable, human-answered input step that surfaces
in the notification bell and rich modal.
def answer = askInteractive(
prompt: 'Which environment should I deploy to?',
choices: [
[id: 'staging', label: 'Staging', why: 'Latest passing build hash matches.'],
[id: 'production', label: 'Production', why: 'PR was tagged release/*.']
],
allowFreeText: false,
slaMinutes: 15,
submitterFilter: null,
contextMarkdown: null)
Return value: the picked choice id (String); or [text: '...', choice: null] for
free text; the sentinel "__deny__" (a human denied but chose to continue) or
"__skip__" (an automation skipped the input) — both let the pipeline branch and carry on. A
Deny/abort instead aborts the run (Result.ABORTED, via a
FlowInterruptedException, like the built-in input step); a TimeoutException
is thrown on SLA expiry.
Parameters (B24). To serve as a drop-in for the built-in input step, the step also
accepts a list of ParameterDefinitions via parameters. When present, the human fills
in a typed form (text / boolean / choice / password) instead of picking a choice, and the submitted
values are returned with the same contract as input: a single parameter returns its
value directly; multiple parameters return a Map of name→value. Values are created and
validated through Jenkins' own SimpleParameterDefinition.createValue(String).
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanlongvoidsetAllowFreeText(boolean allowFreeText) voidsetChoices(List<Choice> choices) voidsetContextMarkdown(String contextMarkdown) voidsetEscalation(String escalation) voidsetParameters(List<ParameterDefinition> parameters) voidsetSlaMinutes(int slaMinutes) voidsetSubmitterFilter(String submitterFilter) org.jenkinsci.plugins.workflow.steps.StepExecutionstart(org.jenkinsci.plugins.workflow.steps.StepContext context) Methods inherited from class org.jenkinsci.plugins.workflow.steps.Step
getDescriptor
-
Constructor Details
-
AskInteractiveStep
-
-
Method Details
-
getPrompt
-
getChoices
-
setChoices
-
getParameters
-
setParameters
-
isAllowFreeText
public boolean isAllowFreeText() -
setAllowFreeText
@DataBoundSetter public void setAllowFreeText(boolean allowFreeText) -
getSlaMinutes
public int getSlaMinutes() -
setSlaMinutes
@DataBoundSetter public void setSlaMinutes(int slaMinutes) -
getSubmitterFilter
-
setSubmitterFilter
-
getContextMarkdown
-
setContextMarkdown
-
getEscalation
-
setEscalation
-
resolveSlaMs
public long resolveSlaMs()- Returns:
- the effective SLA in milliseconds, resolving the JCasC default when unset.
-
start
public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception - Specified by:
startin classorg.jenkinsci.plugins.workflow.steps.Step- Throws:
Exception
-