Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69900

Unable to return a declaratively defined stage from closure to jenkins shared library

XMLWordPrintable

      Hi Everyone!
      I have been working on creating a jenkins shared library, and it works perfectly for a generalized pipeline template. Recently I had the need to pass an extra user-defined stage to my generalized pipeline. I am using closure to do so, but facing some issues with it.
      I would like for the closure to return a declarative stage which has its own agent, steps and other components as shown in the code samples below (refer the following images) :

      Closure defined in .jenkinsfile | Call to closure from jenkins shared library | Error Message :

      Please let me know how can I achieve the above functionality.

        1. call_to_closure.png
          call_to_closure.png
          53 kB
        2. error_msg.png
          error_msg.png
          10 kB
        3. jenkins_closure.png
          jenkins_closure.png
          60 kB

            Unassigned Unassigned
            parthivi95 Parthivi Varshney
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: