Hi, 

In my declarative pipeline I'm using some data from parent job, till now I 
was processing those in single script clause and setting :

String ParentJobName = ""
String ParentBuildNumber = ""

pipeline {
stages {
stage ('Read Parameters') {
steps {
script {
def parentJob = GetParentJob(params.VERBOSE)
ParentJobName = parentJob.getName()

def parentBuild = GetParentBuild(parentJob, params.VERBOSE)
ParentBuildNumber = parentBuild.getNumber()
...

this was working fine, and both ParentJobName and ParentBuildNumer were 
populated fine, 

as I now wanted to do more than just getting single string I tried to 
declare

import org.jenkinsci.plugins.workflow.job.WorkflowJob
import org.jenkinsci.plugins.workflow.job.WorkflowRun

WorkflowJob ParentJob
WorkflowRun ParentBuild

outside of pipeline (like Strings previously)

but this ends up with java.io.NotSerializableException: 
org.jenkinsci.plugins.workflow.job.WorkflowJob exception

wonder if there is a way to achieve it, so I want have to evaluate those 
every time I want to use them.

thanks
Jakub

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/dad15c83-74c5-4803-ae78-91275a1fb130%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to