<p>Looking at the source of one of my Spinnaker pipelines, my Build stage has the following artifact listed in it's context:</p>

<pre><code>
"context": {
    "account": "default",
    "artifacts": [
      {
        "location": "goldengoose",
        "metadata": {
          "account": "default"
        },
        "name": "goldengoose-build",
        "reference": "goldengoose-build-v007",
        "type": "kubernetes/Build",
        "version": "v007"
      }
    ], ...

</code></pre>

<p>How can I access the reference field of this artifact in an upstream stage and template it into a Kubernetes deploy manifest stage? I am trying to do something like the following in the manifest source:</p>

<pre><code>${#stage("Build")["context"]["artifacts"]["0"]["reference"]}
</code></pre>

<p>but the required value isn't being replaced. Is there a way to get this to work?</p>

dippynark
<p>Replace ["0"] with [0] - it is an index of array.</p>
