【Jenkins】フリースタイルのジョブでも手軽にビルドの情報を参照・編集したい

パイプラインジョブみたいに:bangbang:

# 背景

例えばJenkinsのパラメータ付きジョブで、Jenkinsのビルドの「説明」にパラメータ(例えばデプロイ先環境など)を設定しておくと便利です。

パイプラインジョブだと`currentBuild`で現在のビルドの情報にアクセスできる[^globalVariable] ので、以下のように簡単に設定できます。

[^globalVariable]: [Getting started with Pipeline#global-variable-reference](https://www.jenkins.io/doc/book/pipeline/getting-started/#global-variable-reference)

```groovy:Jenkinsfile
script {
    currentBuild.description = "${targetEnv}"
    // リンクも貼れちゃう
    // currentBuild.description = "<a target="_blank" href="...">${targetEnv}</a>"
}
```

一方で、残念ながらJenkins1系の時からある古いジョブを使ってる職場もあります。
(あとパイプラインからだと使えないor使いづらいプラグインを使いたい場合とか)

昔ながらのフリースタイルのジョブだと、以下のように`curl`を使う方法があります。

```bash:シェルの実行
# ※`displayName`も必須なので設定しない場合はデフォルトのものが使われるように空文字を渡しておく
cat <<EOF |
{"displayName":"", "description":"${targetEnv}"}
EOF
curl -u user_name:api_token -s ${BUILD_URL}configSubmit -X POST --data-urlencode json@-
```

参考：[ほげめも: Jenkins のビルド情報の自動設定](http://blog.keshi.org/hogememo/2012/12/14/jenkins-setting-build-info)


でもそもそも自分自身の情報書き換えるためだけに`curl`使うのも変な感じだし、 API トークン使ったりもしたくない……
かといってこのためだけにJenkinsfileに書き換える訳にもいかず……
ということで他の方法を探しました。

# やり方：Groovy pluginを使う

環境

- Jenkins：2.176.1
- Groovy plugin：2.2

[Groovy plugin - Jenkins - Jenkins Wiki](https://wiki.jenkins.io/display/JENKINS/Groovy+plugin) [^groovyPlugin] の「Execute system Groovy script」を使います。
[^groovyPlugin]: プラグイン一覧上ではプラグイン名だけで説明がないし、プラグイン名が1単語なので探しづらい……

<img width="813" alt="「プラグインの管理」ページのGroovyプラグイン" title="「プラグインの管理」ページのGroovyプラグイン" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/92278/4080fc89-a4bd-3c39-39b6-f802f81bce04.png">

このプラグインを導入することにより、フリースタイルのジョブの「ビルド手順の追加」で、Groovyで記述した処理を追加することができるようになります。
具体的には、「Execute Groovy script」と「Execute system Groovy script」が選択できるようになりますが、その中でも後者の「Execute system Groovy script」の方を使うと、Jenkinsfileと同じように現在のビルドの情報に触れます。

<img width="505" alt="ジョブの「設定」の「ビルド手順の追加」" title="ジョブの「設定」の「ビルド手順の追加」" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/92278/54b352db-c671-84f8-824b-8eecd9b914a8.png">


```groovy:Execute&nbsp;system&nbsp;Groovy&nbsp;script
build.description=build.buildVariableResolver.resolve("targetEnv")
// こっちでもとりあえずは動いたけど……
// build.description=build.buildVariables.targetEnv
```

ポイントとしては、「Execute system Groovy script」の場合はGroovy周りの設定(「システムの設定」とか「Global Tool Configuration」とか)は一切不要で、
プラグインをインストールしたらすぐ「ビルド手順の追加」で追加しちゃってokってトコです。
(おそらくJenkinsfile動かす時と同じGroovyが使われるから……)

(逆に設定しようとしてハマりました…… :cry:)

# 別解
[Jenkins CLIを利用してビルドの表示名、説明を設定する - Qiita](https://qiita.com/NaokiIshimura/items/9feccbf546470564d5a4)

- :sunny: プラグイン入れなくていい
- :sunny: 「シェルの実行」をすでに対象ジョブで使ってるならそこに追記でいい
- :cloud: 見た目はGroovyの方がスッキリかも……
- :umbrella: シェルスクリプトではなくGroovyで書きたい場合はNG
- :umbrella: 「表示名」「説明」以外のビルドの情報は触れないかも？


# 付録

`build`で何ができるかとかのドキュメントが少ない([Example](https://plugins.jenkins.io/groovy/#Groovyplugin-Retrievingparametersandtriggeringanotherbuild)くらい？)ので、
`build`のpropertieとmethodを覗いてみたものを貼っておきます。

実行コード

```groovy:Execute&nbsp;system&nbsp;Groovy&nbsp;script
println build
println build.getClass()

println()
println '[properties]'
build.properties.each { property ->
    // class java.util.LinkedHashMap$Entry
    if (property.getKey() =='log') {
        println'log={ここまでのコンソール出力：見辛くなるので省略}'
    } else {
        println property
    }
}

println()
println '[methods]'
build.metaClass.methods.each { method ->
    println method
}
```

結果：コンソール出力 ※長いのでdetailsで折りたたんでます

<details>
<summary>コンソール出力を表示する</summary><div>

```log:コンソール出力
test1 #38
class hudson.model.FreeStyleBuild

[properties]
moduleRoot=/var/jenkins_home/workspace/test1
rootDir=/var/jenkins_home/jobs/test1/builds/38
artifactManager=jenkins.model.StandardArtifactManager@7d22a98c
time=Sat May 09 12:03:49 UTC 2020
logUpdated=true
logReader=java.io.InputStreamReader@45c8674a
searchIndex=hudson.search.FixedSet@1caa0f0f
upstreamBuilds={}
previousNotFailedBuild=test1 #37
ACL=hudson.security.SparseACL@28f70322
startTimeInMillis=1589025829606
search=hudson.search.Search@49b74221
actions=[
	hudson.model.ParametersAction@2131fc52,
	hudson.model.CauseAction@27c53d09
]
previousCompletedBuild=test1 #37
buildFingerprints=[]
result=null
previousSuccessfulBuild=test1 #37
causes=[hudson.model.Cause$UserIdCause@586036e]
timeInMillis=1589025829597
displayName=#38
fullDisplayName=test1 #38
truncatedDescription=null
inProgress=true
searchName=#38
aggregatedTestResultAction=null
absoluteUrl=http://localhost:8080/job/test1/38/
charset=UTF-8
testResultAction=null
changeSets=[]
url=job/test1/38/
logText=hudson.console.AnnotatedLargeText@180e6d99
externalizableId=test1#38
api=hudson.model.Api@3673c1a6
searchUrl=38/
transitiveUpstreamBuilds={}
iconColor=blue_anime
previousFailedBuild=test1 #28
workspace=/var/jenkins_home/workspace/test1
previousBuild=test1 #37
buildVariableResolver=hudson.util.VariableResolver$ByMap@38509f14
builtOn=hudson.model.Hudson@3e04382d
previousBuiltBuild=test1 #37
moduleRoots=[Lhudson.FilePath;@f587343
whyKeepLog=null
culprits=[]
parent=hudson.model.FreeStyleProject@48ccdb0c[test1]
durationString=74 ms and counting
log={ここまでのコンソール出力：見辛くなるので省略}
environment={
	BUILD_DISPLAY_NAME=#38,
	BUILD_ID=38,
	BUILD_NUMBER=38,
	BUILD_TAG=jenkins-test1-38,
	BUILD_URL=http://localhost:8080/job/test1/38/,
	CLASSPATH=,
	COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log,
	EXECUTOR_NUMBER=0,
	HOME=/var/jenkins_home,
	HOSTNAME=d2e3a42c38f6,
	HUDSON_HOME=/var/jenkins_home,
	HUDSON_SERVER_COOKIE=78a3225e439c1027,
	HUDSON_URL=http://localhost:8080/,
	JAVA_BASE_URL=https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u212-b04/OpenJDK8U-,
	JAVA_HOME=/usr/local/openjdk-8,
	JAVA_URL_VERSION=8u212b04,
	JAVA_VERSION=8u212-b04,
	JENKINS_HOME=/var/jenkins_home,
	JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals,
	JENKINS_SERVER_COOKIE=78a3225e439c1027,
	JENKINS_SLAVE_AGENT_PORT=50000,
	JENKINS_UC=https://updates.jenkins.io,
	JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental,
	JENKINS_URL=http://localhost:8080/,
	JENKINS_VERSION=2.176.1,
	JOB_BASE_NAME=test1,
	JOB_DISPLAY_URL=http://localhost:8080/job/test1/display/redirect,
	JOB_NAME=test1,
	JOB_URL=http://localhost:8080/job/test1/,
	LANG=C.UTF-8,
	NODE_LABELS=master,
	NODE_NAME=master,
	PATH=/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,
	PWD=/,
	RUN_CHANGES_DISPLAY_URL=http://localhost:8080/job/test1/38/display/redirect?page=changes,
	RUN_DISPLAY_URL=http://localhost:8080/job/test1/38/display/redirect,
	SHLVL=0,
	testParam=hogefuga,
	WORKSPACE=/var/jenkins_home/workspace/test1
}
badgeActions=[]
sensitiveBuildVariables=[]
transientActions=[]
id=38
hasArtifacts=false
previousBuildInProgress=null
keepLog=false
culpritIds=null
timestamp=java.util.GregorianCalendar[
    time=1589025829597,
	areFieldsSet=true,
	areAllFieldsSet=true,
	lenient=true,
	zone=sun.util.calendar.ZoneInfo[id="Etc/UTC",
	offset=0,
	dstSavings=0,
	useDaylight=false,
	transitions=0,
	lastRule=null],
	firstDayOfWeek=1,
	minimalDaysInFirstWeek=1,
	ERA=1,
	YEAR=2020,
	MONTH=4,
	WEEK_OF_YEAR=19,
	WEEK_OF_MONTH=2,
	DAY_OF_MONTH=9,
	DAY_OF_YEAR=130,
	DAY_OF_WEEK=7,
	DAY_OF_WEEK_IN_MONTH=2,
	AM_PM=1,
	HOUR=0,
	HOUR_OF_DAY=12,
	MINUTE=3,
	SECOND=49,
	MILLISECOND=597,
	ZONE_OFFSET=0,
	DST_OFFSET=0
]
number=38
class=class hudson.model.FreeStyleBuild
downstreamBuilds={}
changeSet=hudson.scm.EmptyChangeLogSet@64d1b594
buildStatusUrl=blue_anime.gif
nextBuild=null
envVars={
	BUILD_DISPLAY_NAME=#38,
	BUILD_ID=38,
	BUILD_NUMBER=38,
	BUILD_TAG=jenkins-test1-38,
	BUILD_URL=http://localhost:8080/job/test1/38/,
	CLASSPATH=,
	COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log,
	EXECUTOR_NUMBER=0,
	HOME=/var/jenkins_home,
	HOSTNAME=d2e3a42c38f6,
	HUDSON_HOME=/var/jenkins_home,
	HUDSON_SERVER_COOKIE=78a3225e439c1027,
	HUDSON_URL=http://localhost:8080/,
	JAVA_BASE_URL=https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u212-b04/OpenJDK8U-,
	JAVA_HOME=/usr/local/openjdk-8,
	JAVA_URL_VERSION=8u212b04,
	JAVA_VERSION=8u212-b04,
	JENKINS_HOME=/var/jenkins_home,
	JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals,
	JENKINS_SERVER_COOKIE=78a3225e439c1027,
	JENKINS_SLAVE_AGENT_PORT=50000,
	JENKINS_UC=https://updates.jenkins.io,
	JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental,
	JENKINS_URL=http://localhost:8080/,
	JENKINS_VERSION=2.176.1,
	JOB_BASE_NAME=test1,
	JOB_DISPLAY_URL=http://localhost:8080/job/test1/display/redirect,
	JOB_NAME=test1,
	JOB_URL=http://localhost:8080/job/test1/,
	LANG=C.UTF-8,
	NODE_LABELS=master,
	NODE_NAME=master,
	PATH=/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,
	PWD=/,
	RUN_CHANGES_DISPLAY_URL=http://localhost:8080/job/test1/38/display/redirect?page=changes,
	RUN_DISPLAY_URL=http://localhost:8080/job/test1/38/display/redirect,
	SHLVL=0,
	testParam=hogefuga,
	WORKSPACE=/var/jenkins_home/workspace/test1
}
duration=0
artifacts=[]
executor=Thread[Executor #0 for master : executing test1 #38,5,main]
target=test1 #38
oneOffExecutor=null
timestampString=0.11 sec
hudsonVersion=2.176.1
building=true
queueId=38
logInputStream=sun.nio.ch.ChannelInputStream@4c072659
environments=[
	hudson.model.listeners.RunListener$1@7013b8f2,
	hudson.model.listeners.RunListener$1@3c1d0fd8,
	hudson.model.listeners.RunListener$1@550960da,
	hudson.model.listeners.RunListener$1@2049b1cc,
	hudson.model.listeners.RunListener$1@4df0491f,
	hudson.model.listeners.RunListener$1@1947ecb6,
	hudson.model.listeners.RunListener$1@75640f4,
	hudson.model.listeners.RunListener$1@6afc4603,
	hudson.model.listeners.RunListener$1@258b52f2,
	hudson.model.listeners.RunListener$1@30f28a9,
	hudson.model.listeners.RunListener$1@366b89dc
]
persistentActions=[
	hudson.model.ParametersAction@2131fc52,
	hudson.model.CauseAction@27c53d09
]
rootBuild=test1 #38
buildStatusSummary=hudson.model.Run$Summary@3eaf0d4c
buildVariables={testParam=hogefuga}
builtOnStr=
runMixIn=hudson.model.AbstractBuild$1@41ccc4a9
logFile=/var/jenkins_home/jobs/test1/builds/38/log
artifactsDir=/var/jenkins_home/jobs/test1/builds/38/archive
allActions=[
	hudson.model.ParametersAction@2131fc52,
	hudson.model.CauseAction@27c53d09,
	hudson.plugins.timestamper.action.TimestampsAction@3b7cf659,
	org.jenkinsci.plugins.displayurlapi.actions.RunDisplayAction@51b3bd83
]
description=null
project=hudson.model.FreeStyleProject@48ccdb0c[test1]
timestampString2=2020-05-09T12:03:49Z
buildStatusIconClassName=icon-blue-anime
estimatedDuration=230
characteristicEnvVars={
	BUILD_ID=38,
	BUILD_NUMBER=38,
	BUILD_TAG=jenkins-test1-38,
	HUDSON_SERVER_COOKIE=78a3225e439c1027,
	JENKINS_SERVER_COOKIE=78a3225e439c1027,
	JOB_BASE_NAME=test1,
	JOB_NAME=test1
}

[methods]
public boolean java.lang.Object.equals(java.lang.Object)
public final native java.lang.Class java.lang.Object.getClass()
public native int java.lang.Object.hashCode()
public final native void java.lang.Object.notify()
public final native void java.lang.Object.notifyAll()
public java.lang.String java.lang.Object.toString()
public final void java.lang.Object.wait() throws java.lang.InterruptedException
public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException
public final void java.lang.Object.wait(long,int) throws java.lang.InterruptedException
public hudson.search.Search hudson.model.AbstractModelObject.getSearch()
public final hudson.search.SearchIndex hudson.model.AbstractModelObject.getSearchIndex()
public java.lang.String hudson.model.AbstractModelObject.getSearchName()
public void hudson.model.Actionable.addAction(hudson.model.Action)
public boolean hudson.model.Actionable.addOrReplaceAction(hudson.model.Action)
public jenkins.model.ModelObjectWithContextMenu$ContextMenu hudson.model.Actionable.doContextMenu(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.lang.Exception
public hudson.model.Action hudson.model.Actionable.getAction(int)
public hudson.model.Action hudson.model.Actionable.getAction(java.lang.Class)
public java.util.List hudson.model.Actionable.getActions()
public java.util.List hudson.model.Actionable.getActions(java.lang.Class)
public final java.util.List hudson.model.Actionable.getAllActions()
public java.lang.Object hudson.model.Actionable.getDynamic(java.lang.String,org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse)
public boolean hudson.model.Actionable.removeAction(hudson.model.Action)
public boolean hudson.model.Actionable.removeActions(java.lang.Class)
public void hudson.model.Actionable.replaceAction(hudson.model.Action)
public boolean hudson.model.Actionable.replaceActions(java.lang.Class,hudson.model.Action)
public void hudson.model.Run.addAction(hudson.model.Action)
public boolean hudson.model.Run.canToggleLogKeep()
public int hudson.model.Run.compareTo(hudson.model.Run)
public void hudson.model.Run.delete() throws java.io.IOException
public synchronized void hudson.model.Run.deleteArtifacts() throws java.io.IOException
public hudson.model.DirectoryBrowserSupport hudson.model.Run.doArtifact()
public void hudson.model.Run.doBuildNumber(org.kohsuke.stapler.StaplerResponse) throws java.io.IOException
public void hudson.model.Run.doBuildStatus(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException
public void hudson.model.Run.doBuildTimestamp(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse,java.lang.String) throws java.io.IOException
public org.kohsuke.stapler.HttpResponse hudson.model.Run.doConfigSubmit(org.kohsuke.stapler.StaplerRequest) throws java.io.IOException,javax.servlet.ServletException,hudson.model.Descriptor$FormException
public void hudson.model.Run.doConsoleText(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException
public void hudson.model.Run.doDoDelete(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException,javax.servlet.ServletException
public void hudson.model.Run.doProgressiveLog(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException
public synchronized void hudson.model.Run.doSubmitDescription(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException,javax.servlet.ServletException
public void hudson.model.Run.doToggleLogKeep(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException,javax.servlet.ServletException
public static hudson.model.Run hudson.model.Run.fromExternalizableId(java.lang.String) throws java.lang.IllegalArgumentException
public hudson.security.ACL hudson.model.Run.getACL()
public final java.lang.String hudson.model.Run.getAbsoluteUrl()
public hudson.model.Api hudson.model.Run.getApi()
public final jenkins.model.ArtifactManager hudson.model.Run.getArtifactManager()
public java.util.List hudson.model.Run.getArtifacts()
public java.io.File hudson.model.Run.getArtifactsDir()
public java.util.List hudson.model.Run.getArtifactsUpTo(int)
public java.util.List hudson.model.Run.getBadgeActions()
public java.util.Collection hudson.model.Run.getBuildFingerprints()
public java.lang.String hudson.model.Run.getBuildStatusIconClassName()
public hudson.model.Run$Summary hudson.model.Run.getBuildStatusSummary()
public java.lang.String hudson.model.Run.getBuildStatusUrl()
public hudson.model.Cause hudson.model.Run.getCause(java.lang.Class)
public java.util.List hudson.model.Run.getCauses()
public final hudson.EnvVars hudson.model.Run.getCharacteristicEnvVars()
public final java.nio.charset.Charset hudson.model.Run.getCharset()
public java.lang.String hudson.model.Run.getDescription()
public java.lang.String hudson.model.Run.getDisplayName()
public long hudson.model.Run.getDuration()
public java.lang.String hudson.model.Run.getDurationString()
public java.lang.Object hudson.model.Run.getDynamic(java.lang.String,org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse)
public java.util.Map hudson.model.Run.getEnvVars()
public hudson.EnvVars hudson.model.Run.getEnvironment() throws java.io.IOException,java.lang.InterruptedException
public hudson.EnvVars hudson.model.Run.getEnvironment(hudson.model.TaskListener) throws java.io.IOException,java.lang.InterruptedException
public long hudson.model.Run.getEstimatedDuration()
public hudson.model.Executor hudson.model.Run.getExecutor()
public java.lang.String hudson.model.Run.getExternalizableId()
public java.lang.String hudson.model.Run.getFullDisplayName()
public boolean hudson.model.Run.getHasArtifacts()
public hudson.model.BallColor hudson.model.Run.getIconColor()
public java.lang.String hudson.model.Run.getId()
public java.lang.String hudson.model.Run.getLog() throws java.io.IOException
public java.util.List hudson.model.Run.getLog(int) throws java.io.IOException
public java.io.File hudson.model.Run.getLogFile()
public java.io.InputStream hudson.model.Run.getLogInputStream() throws java.io.IOException
public java.io.Reader hudson.model.Run.getLogReader() throws java.io.IOException
public hudson.console.AnnotatedLargeText hudson.model.Run.getLogText()
public hudson.model.Run hudson.model.Run.getNextBuild()
public int hudson.model.Run.getNumber()
public hudson.model.Executor hudson.model.Run.getOneOffExecutor()
public hudson.model.Job hudson.model.Run.getParent()
public hudson.model.Run hudson.model.Run.getPreviousBuild()
public final hudson.model.Run hudson.model.Run.getPreviousBuildInProgress()
public java.util.List hudson.model.Run.getPreviousBuildsOverThreshold(int,hudson.model.Result)
public hudson.model.Run hudson.model.Run.getPreviousBuiltBuild()
public final hudson.model.Run hudson.model.Run.getPreviousCompletedBuild()
public hudson.model.Run hudson.model.Run.getPreviousFailedBuild()
public hudson.model.Run hudson.model.Run.getPreviousNotFailedBuild()
public hudson.model.Run hudson.model.Run.getPreviousSuccessfulBuild()
public long hudson.model.Run.getQueueId()
public hudson.model.Result hudson.model.Run.getResult()
public java.io.File hudson.model.Run.getRootDir()
public final java.lang.String hudson.model.Run.getSearchUrl()
public final long hudson.model.Run.getStartTimeInMillis()
public java.lang.Object hudson.model.Run.getTarget()
public final java.util.Date hudson.model.Run.getTime()
public final long hudson.model.Run.getTimeInMillis()
public java.util.Calendar hudson.model.Run.getTimestamp()
public java.lang.String hudson.model.Run.getTimestampString()
public java.lang.String hudson.model.Run.getTimestampString2()
public java.util.List hudson.model.Run.getTransientActions()
public java.lang.String hudson.model.Run.getTruncatedDescription()
public java.lang.String hudson.model.Run.getUrl()
public java.lang.String hudson.model.Run.getWhyKeepLog()
public boolean hudson.model.Run.hasCustomDisplayName()
public boolean hudson.model.Run.hasntStartedYet()
public boolean hudson.model.Run.isBuilding()
public final boolean hudson.model.Run.isKeepLog()
public boolean hudson.model.Run.isLogUpdated()
public final void hudson.model.Run.keepLog() throws java.io.IOException
public void hudson.model.Run.keepLog(boolean) throws java.io.IOException
public final synchronized jenkins.model.ArtifactManager hudson.model.Run.pickArtifactManager() throws java.io.IOException
public void hudson.model.Run.reload() throws java.io.IOException
public synchronized void hudson.model.Run.save() throws java.io.IOException
public void hudson.model.Run.setDescription(java.lang.String) throws java.io.IOException
public void hudson.model.Run.setDisplayName(java.lang.String) throws java.io.IOException
public void hudson.model.Run.setQueueId(long)
public void hudson.model.Run.setResult(hudson.model.Result)
public java.lang.String hudson.model.Run.toString()
public final void hudson.model.Run.updateSymlinks(hudson.model.TaskListener) throws java.lang.InterruptedException
public void hudson.model.Run.writeLogTo(long,org.apache.commons.jelly.XMLOutput) throws java.io.IOException
public void hudson.model.Run.writeWholeLogTo(java.io.OutputStream) throws java.io.IOException,java.lang.InterruptedException
public void hudson.model.AbstractBuild.addAction(hudson.model.Action)
public java.util.Set hudson.model.AbstractBuild.calculateCulprits()
public synchronized org.kohsuke.stapler.HttpResponse hudson.model.AbstractBuild.doStop() throws java.io.IOException,javax.servlet.ServletException
public void hudson.model.AbstractBuild.doStop(org.kohsuke.stapler.StaplerRequest,org.kohsuke.stapler.StaplerResponse) throws java.io.IOException,javax.servlet.ServletException
public java.util.Calendar hudson.model.AbstractBuild.due()
public hudson.model.Action hudson.model.AbstractBuild.getAggregatedTestResultAction()
public final hudson.util.VariableResolver hudson.model.AbstractBuild.getBuildVariableResolver()
public java.util.Map hudson.model.AbstractBuild.getBuildVariables()
public hudson.model.Node hudson.model.AbstractBuild.getBuiltOn()
public java.lang.String hudson.model.AbstractBuild.getBuiltOnStr()
public hudson.scm.ChangeLogSet hudson.model.AbstractBuild.getChangeSet()
public java.util.List hudson.model.AbstractBuild.getChangeSets()
public java.util.Set hudson.model.AbstractBuild.getCulpritIds()
public java.util.Set hudson.model.AbstractBuild.getCulprits()
public java.util.Map hudson.model.AbstractBuild.getDependencyChanges(hudson.model.AbstractBuild)
public java.lang.Iterable hudson.model.AbstractBuild.getDownstreamBuilds(hudson.model.AbstractProject)
public java.util.Map hudson.model.AbstractBuild.getDownstreamBuilds()
public hudson.model.Fingerprint$RangeSet hudson.model.AbstractBuild.getDownstreamRelationship(hudson.model.AbstractProject)
public hudson.EnvVars hudson.model.AbstractBuild.getEnvironment(hudson.model.TaskListener) throws java.io.IOException,java.lang.InterruptedException
public hudson.model.EnvironmentList hudson.model.AbstractBuild.getEnvironments()
public java.lang.String hudson.model.AbstractBuild.getHudsonVersion()
public final hudson.FilePath hudson.model.AbstractBuild.getModuleRoot()
public hudson.FilePath[] hudson.model.AbstractBuild.getModuleRoots()
public hudson.model.AbstractBuild hudson.model.AbstractBuild.getNextBuild()
public java.util.List hudson.model.AbstractBuild.getPersistentActions()
public hudson.model.AbstractBuild hudson.model.AbstractBuild.getPreviousBuild()
public final hudson.model.AbstractProject hudson.model.AbstractBuild.getProject()
public hudson.model.AbstractBuild hudson.model.AbstractBuild.getRootBuild()
public final jenkins.model.lazy.LazyBuildMixIn$RunMixIn hudson.model.AbstractBuild.getRunMixIn()
public java.util.Set hudson.model.AbstractBuild.getSensitiveBuildVariables()
public hudson.model.Action hudson.model.AbstractBuild.getTestResultAction()
public java.util.Map hudson.model.AbstractBuild.getTransitiveUpstreamBuilds()
public java.lang.String hudson.model.AbstractBuild.getUpUrl()
public java.util.Map hudson.model.AbstractBuild.getUpstreamBuilds()
public int hudson.model.AbstractBuild.getUpstreamRelationship(hudson.model.AbstractProject)
public hudson.model.AbstractBuild hudson.model.AbstractBuild.getUpstreamRelationshipBuild(hudson.model.AbstractProject)
public java.lang.String hudson.model.AbstractBuild.getWhyKeepLog()
public final hudson.FilePath hudson.model.AbstractBuild.getWorkspace()
public boolean hudson.model.AbstractBuild.hasChangeSetComputed()
public abstract void hudson.model.AbstractBuild.run()
public boolean hudson.model.AbstractBuild.shouldCalculateCulprits()
public void hudson.model.Build.run()
public void hudson.model.FreeStyleBuild.run()
```

</div></details>