[JIRA] [claim-plugin] (JENKINS-33969) claim-plugin cannot be used with pipelines (workflows)

3 views
Skip to first unread message

sorin.sbarnea@gmail.com (JIRA)

unread,
Mar 31, 2016, 6:37:01 PM3/31/16
to jenkinsc...@googlegroups.com
Sorin Sbarnea created an issue
 
Jenkins / Bug JENKINS-33969
claim-plugin cannot be used with pipelines (workflows)
Issue Type: Bug Bug
Assignee: Christian Bremer
Components: claim-plugin
Created: 2016/Mar/31 10:36 PM
Labels: Jenkinsfile
Priority: Major Major
Reporter: Sorin Sbarnea

It seems that the claim plugin cannot be used anymore with the pipeline jobs in Jenkins (pipeline plugin, github-organization-plugin) – those using the Jenkinsfile.

As these are quickly becoming the standard way of defining Jenkins jobs, we do need a way to enable claiming for them.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mark@bluedixie.co.uk (JIRA)

unread,
Aug 23, 2016, 1:24:02 PM8/23/16
to jenkinsc...@googlegroups.com
Mark Jones commented on Bug JENKINS-33969
 
Re: claim-plugin cannot be used with pipelines (workflows)

To clarify I can successfully add the step in my JenkinsFile:

{{step([$class: 'ClaimPublisher']) }}

and I get the message on the build page 'This build was not claimed' but there is no link to claim the build. I am logged in as admin and can claim non pipeline builds.

plugin version: V0.8
Jenkins version: V2.12

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Sep 27, 2016, 5:10:02 PM9/27/16
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Change By: Jesse Glick
Labels: Jenkinsfile pipeline

at.ramya@gmail.com (JIRA)

unread,
Sep 29, 2016, 2:31:02 AM9/29/16
to jenkinsc...@googlegroups.com
Ramya Authappan commented on Bug JENKINS-33969
 
Re: claim-plugin cannot be used with pipelines (workflows)

Hi is there a way to workaround this issue?

I add this in my Jenkinsfile:
step([$class: 'ClaimPublisher'])

But i see nothing after the build faliure.

Jenkins version: 2.20
Claim Plugin Version: 2.8

lostinberlin2010@gmail.com (JIRA)

unread,
Apr 4, 2018, 8:05:02 AM4/4/18
to jenkinsc...@googlegroups.com

As a side note, the ClaimPublisher step needs a node to work meaning it will fail if you are

  • using the declarative pipeline
  • using stage-based agents (setting agent none under the global pipeline declaration)

you will need to put the step in a node closure

pipeline {
  agent none
  stages {
    stage('Build') {
      agent any
      steps {
        bat 'exit 1;'
      }
    }
  }
  post {
    always {
      // need the node closure here because agent none was set above
      node {
        step([$class: 'ClaimPublisher'])
      }
    }
  }
}
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

arnaud.dev@gmail.com (JIRA)

unread,
Jan 5, 2019, 12:29:11 PM1/5/19
to jenkinsc...@googlegroups.com
Arnaud TAMAILLON assigned an issue to Arnaud TAMAILLON
 
Change By: Arnaud TAMAILLON
Assignee: Christian Bremer Arnaud TAMAILLON
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

natanayalon@gmail.com (JIRA)

unread,
Jul 16, 2019, 9:01:02 AM7/16/19
to jenkinsc...@googlegroups.com
Nathan Ayalon commented on Bug JENKINS-33969
 
Re: claim-plugin cannot be used with pipelines (workflows)

Claim plugin works perfect with scripted pipeline.

All you need to do is add this step to the catch scope: step([$class: 'ClaimPublisher'])

Use the folowing example:

 

def jobs = ["1", "2", "3"]
node {
 jobs.each {job ->
  stage("${job}") {
   try {
    echo "${job}"
    if ("${job}" == '2') { // illustrate a failure
     throw -1
    }
    currentBuild.result = 'SUCCESS'
   }
   catch (exc) {
    currentBuild.result = 'FAILURE'
    echo "Job ${job} failed'"
    step([$class: 'ClaimPublisher'])
   }
  }
 }
}

 

 

natanayalon@gmail.com (JIRA)

unread,
Jul 17, 2019, 4:03:02 AM7/17/19
to jenkinsc...@googlegroups.com
Nate Tunes edited a comment on Bug JENKINS-33969
Claim plugin works perfect with scripted pipeline.

All you need to do is add this step to the catch scope: step([$class: 'ClaimPublisher'])

Use the folowing example:

 
{code:java}

def jobs = ["1", "2", "3"]
node {
jobs.each {job ->
  stage("${job}") {
   try {
    echo "${job}"
    if ("${job}" == '2') { // illustrate a failure
     throw -1
    }
    currentBuild.result = 'SUCCESS'
   }
   catch (exc) {
    currentBuild.result = 'FAILURE'
    echo "Job ${job} failed'"
    step([$class: 'ClaimPublisher'])
   }
  }
}
}
{code}
 

 
Reply all
Reply to author
Forward
0 new messages