[JIRA] (JENKINS-41853) "when" is not recognized as part of the pipeline DSL

5 views
Skip to first unread message

mydoal@gmail.com (JIRA)

unread,
Feb 8, 2017, 12:53:02 PM2/8/17
to jenkinsc...@googlegroups.com
Roi Aldaag created an issue
 
Jenkins / Bug JENKINS-41853
"when" is not recognized as part of the pipeline DSL
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2017/Feb/08 5:52 PM
Environment: Jenkins: 2.45
Pipeline plugin: 2.5
pipeline-model-definition-plugin: 1.0
Labels: jenkins plugin pipeline
Priority: Major Major
Reporter: Roi Aldaag

when running the following pipeline script:

stage('1') {
when

{ true }

}

the job fails with an excehtion:

java.lang.NoSuchMethodError: No such DSL method 'when' found among steps [ansiblePlaybook, archive, bat, build, catchError, checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, getContext, git, input, isUnix, libraryResource, load, mail, milestone, node, parallel, properties, publishHTML, pwd, readFile, readTrusted, resolveScm, retry, script, sh, slackSend, sleep, stage, stash, step, svn, timeout, timestamps, tool, unarchive, unstash, waitUntil, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, wrap, writeFile, ws] or symbols [all, always, ant, antFromApache, antOutcome, antTarget, any, apiToken, architecture, archiveArtifacts, artifactManager, batchFile, booleanParam, branch, buildButton, buildDiscarder, caseInsensitive, caseSensitive, choice, choiceParam, clock, cloud, command, cron, crumb, defaultView, demand, disableConcurrentBuilds, docker, dockerfile, downloadSettings, downstream, dumb, envVars, environment, expression, file, fileParam, filePath, fingerprint, frameOptions, freeStyle, freeStyleJob, git, hyperlink, hyperlinkToModels, installSource, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobDsl, jobName, junit, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, list, local, location, logRotator, loggedInUsersCanDoAnything, masterBuild, maven, maven3Mojos, mavenErrors, mavenMojos, mavenWarnings, myView, nodeProperties, nonStoredPasswordParam, none, overrideIndexTriggers, paneStatus, parameters, password, pattern, pipeline-model, pipelineTriggers, plainText, plugin, pollSCM, projectNamingStrategy, proxy, queueItemAuthenticator, quietPeriod, run, runParam, schedule, scmRetryCount, search, security, shell, skipDefaultCheckout, slave, stackTrace, standard, status, string, stringParam, swapSpace, text, textParam, tmpSpace, toolLocation, unsecured, upstream, usernameColonPassword, usernamePassword, viewsTabBar, weather, zfs, zip] or globals [currentBuild, docker, env, manager, params, pipeline, scm]

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Feb 10, 2017, 6:45:01 PM2/10/17
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-41853
 
Re: "when" is not recognized as part of the pipeline DSL

Looks like you're not actually using a Declarative Pipeline? Is this all within a pipeline block? Can you attach your Jenkinsfile?

mydoal@gmail.com (JIRA)

unread,
Feb 13, 2017, 10:01:03 AM2/13/17
to jenkinsc...@googlegroups.com

The code that I have posted was for a scripted pipeline not a declarative Jenkins file.
I've checked the "when" closure in the Jenkinsfile and it works fine.
Just to be sure, the "when" clause is NOT supported in the Scripted Pipeline syntax and is only supported in the Declarative Pipeline Jenkinsfile?

andrew.bayer@gmail.com (JIRA)

unread,
Feb 13, 2017, 10:34:01 AM2/13/17
to jenkinsc...@googlegroups.com

Correct, it's a Declarative specific feature.

andrew.bayer@gmail.com (JIRA)

unread,
Feb 22, 2017, 4:21:06 PM2/22/17
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Not A Defect
 
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Not A Defect

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:42 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Not A Defect
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages