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

This issue is archived. You can view it, but you can't modify it. Learn more

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. jenkins_closure.png
          jenkins_closure.png
          60 kB
        2. error_msg.png
          error_msg.png
          10 kB
        3. call_to_closure.png
          call_to_closure.png
          53 kB

            Assignee:
            Unassigned
            Reporter:
            Parthivi Varshney
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: