Discussion:
Best way to set the job description for multi branch pipelines
Lee, David
2018-10-17 14:28:01 UTC
Permalink
Hi Jenkins users -

I am not seeing a really easy and clean way to set the Jenkins job description for multi branch pipelines.

The following code works, however, the downside is 3 in-process script approvals are required (method org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder$BadgeManager getBuild, field hudson.model.Run project, and method hudson.model.AbstractItem setDescription java.lang.String).

def project = manager.build.project
project.setDescription("My job description.")

Am I missing something? Is there a better way to codify the job description into a Jenkinsfile and without requiring any script approvals? Would I need to create a Jenkins plugin?

Any advice appreciated. Thanks.
-D
--
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 jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cb82226c6d6f414ab77117878816c322%40EXCAMB02.rpega.com.
For more options, visit https://groups.google.com/d/optout.
Cuong Tran
2018-10-18 16:47:17 UTC
Permalink
Try this:

currentBuild.description = "You description"
Hi Jenkins users –
I am not seeing a really easy and clean way to set the Jenkins job
description for multi branch pipelines.
The following code works, however, the downside is 3 in-process script
approvals are required (*method
org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder$BadgeManager
getBuild*, *field hudson.model.Run project*, and *method
hudson.model.AbstractItem setDescription java.lang.String*).
def project = manager.build.project
project.setDescription("My job description.")
Am I missing something? Is there a better way to codify the job
description into a Jenkinsfile and without requiring any script approvals?
Would I need to create a Jenkins plugin?
Any advice appreciated. Thanks.
-D
--
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 jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e446d132-07cd-4dd0-9db0-0dddce1c1a92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lee, David
2018-10-22 15:22:25 UTC
Permalink
Thanks for the reply.

currentBuild.description = "You description" sets the build description for each build. I am looking for setting the job/project description.

-D

From: jenkinsci-***@googlegroups.com <jenkinsci-***@googlegroups.com> On Behalf Of Cuong Tran
Sent: Thursday, October 18, 2018 9:47 AM
To: Jenkins Users <jenkinsci-***@googlegroups.com>
Subject: Re: Best way to set the job description for multi branch pipelines

Try this:

currentBuild.description = "You description"

On Wednesday, October 17, 2018 at 7:39:59 AM UTC-7, Lee, David wrote:
Hi Jenkins users –

I am not seeing a really easy and clean way to set the Jenkins job description for multi branch pipelines.

The following code works, however, the downside is 3 in-process script approvals are required (method org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder$BadgeManager getBuild, field hudson.model.Run project, and method hudson.model.AbstractItem setDescription java.lang.String).

def project = manager.build.project
project.setDescription("My job description.")

Am I missing something? Is there a better way to codify the job description into a Jenkinsfile and without requiring any script approvals? Would I need to create a Jenkins plugin?

Any advice appreciated. Thanks.
-D


--
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 jenkinsci-users+***@googlegroups.com<mailto:jenkinsci-users+***@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e446d132-07cd-4dd0-9db0-0dddce1c1a92%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/e446d132-07cd-4dd0-9db0-0dddce1c1a92%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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 jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/db6eab829ec748ad9092cbc19a17c76a%40EXCAMB02.rpega.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...