I am trying to update a Multibranch pipeline project
I have looked into the source code for ComputedFolder and 
DefaultOrphanedItemStrategy to find out how to set it.
DefaultOrphanedItemStrategy extends OrphanedItemStrategy and takes inn a 
boolean,String,String parameter list.

Running Jenkins 2.42, Branch API 1.11.1, Folders 5.16

groovy.lang.MissingMethodException: No signature of method: 
org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject.setOprhanItemStrategy()
 is applicable for argument types: 
(com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy) 
values: 
[com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy@5e1b5c4d]
Possible solutions: 
setOrphanedItemStrategy(com.cloudbees.hudson.plugins.folder.computed.OrphanedItemStrategy),
 getOrphanedItemStrategy()
        at 
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)



The Code:
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
import com.cloudbees.hudson.plugins.folder.computed.
DefaultOrphanedItemStrategy

def jenkinsInstance = jenkins.model.Jenkins.getInstance()
def project = jenkinsInstance.getItem("projectA")
def strategy = new DefaultOrphanedItemStrategy(true, "0", "20")
project.setOprhanItemStrategy(strategy)


-- 
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/20d76141-e7ce-4806-bb40-8f0cbc647f70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to