<p>I was not able to find how to <em>hide</em> a stage, however I found one can skip it using <code>stageEnabled</code> [1].</p>
<p>It takes a Spring Language Expression like so:</p>
<pre class="lang-json prettyprint-override"><code>{
  &quot;stageEnabled&quot;: {
    &quot;expression&quot;: &quot;false&quot;, // you can also use SpEL, e.g. ${someBoolean}
    &quot;type&quot;: &quot;expression&quot;
  },
  &quot;completeOtherBranchesThenFail&quot;: true,
  &quot;continuePipeline&quot;: false,
  &quot;failPipeline&quot;: false,
  &quot;parameters&quot;: {
    &quot;FOO&quot;: &quot;bar&quot;
  },
  &quot;type&quot;: &quot;jenkins&quot;
}
</code></pre>
<p>Or from the UI editor: <code>Execution Options</code> &gt; <code>Conditional on Expression</code> &gt; Enter <code>false</code> [2].</p>
<ol>
<li><a href="https://docs.armory.io/docs/spinnaker-user-guides/using-dinghy/#stage-fields" rel="nofollow noreferrer">https://docs.armory.io/docs/spinnaker-user-guides/using-dinghy/#stage-fields</a></li>
<li><a href="https://spinnaker.io/guides/user/pipeline/expressions/#dynamically-skip-a-stage" rel="nofollow noreferrer">https://spinnaker.io/guides/user/pipeline/expressions/#dynamically-skip-a-stage</a></li>
</ol>

CC BY-SA 4.0
2021-03-12T22:55:06.187Z
2021-03-12T22:55:06.187Z
pyb
<p>I have a pipeline with a few disabled stages:</p>
<pre class="lang-json prettyprint-override"><code>{
  &quot;enabled&quot;: false,
  &quot;completeOtherBranchesThenFail&quot;: true,
  &quot;continuePipeline&quot;: false,
  &quot;failPipeline&quot;: false,
  &quot;parameters&quot;: {
    &quot;FOO&quot;: &quot;bar&quot;
  },
  &quot;type&quot;: &quot;jenkins&quot;
}
</code></pre>
<p>The doc states that disabled stages are hidden from the UI [1]:</p>
<blockquote>
<p><code>enabled</code> - Determines if stage will be available in the UI.</p>
</blockquote>
<p>However, those stages are still present in the UI.</p>
<p>When I go to <code>Configure Pipeline</code> &gt; <code>Edit stage as JSON</code>, the <code>enabled</code> flag is set to <code>false</code>, so the UI has the right value.</p>
<ol>
<li><a href="https://spinnaker.io/guides/operator/custom-job-stages/#creating-a-custom-job-stage" rel="nofollow noreferrer">https://spinnaker.io/guides/operator/custom-job-stages/#creating-a-custom-job-stage</a></li>
</ol>
<p>Spinnaker version 1.23.5</p>

<spinnaker>
Spinnaker keeps showing disabled stages in Jenkins pipeline UI
pyb
# Spinnaker keeps showing disabled stages in Jenkins pipeline UI

(Asked by: username_0 on 2021-03-12)

I have a pipeline with a few disabled stages:
{
  "enabled": false,
  "completeOtherBranchesThenFail": true,
  "continuePipeline": false,
  "failPipeline": false,
  "parameters": {
    "FOO": "bar"
  },
  "type": "jenkins"
}

The doc states that disabled stages are hidden from the UI [1]:

enabled - Determines if stage will be available in the UI.

However, those stages are still present in the UI.
When I go to Configure Pipeline > Edit stage as JSON, the enabled flag is set to false, so the UI has the right value.

https://spinnaker.io/guides/operator/custom-job-stages/#creating-a-custom-job-stage

Spinnaker version 1.23.5

**Tags:** spinnaker


---

## 1 answers

### Answer by username_0 on 2021-03-12. Score: 1 | Accepted answer

I was not able to find how to hide a stage, however I found one can skip it using stageEnabled [1].
It takes a Spring Language Expression like so:
{
  "stageEnabled": {
    "expression": "false", // you can also use SpEL, e.g. ${someBoolean}
    "type": "expression"
  },
  "completeOtherBranchesThenFail": true,
  "continuePipeline": false,
  "failPipeline": false,
  "parameters": {
    "FOO": "bar"
  },
  "type": "jenkins"
}

Or from the UI editor: Execution Options > Conditional on Expression > Enter false [2].

https://docs.armory.io/docs/spinnaker-user-guides/using-dinghy/#stage-fields
https://spinnaker.io/guides/user/pipeline/expressions/#dynamically-skip-a-stage


---

