0

I want to get the description of build parameters of a Jenkins build using groovy.
I want to include this description in an email using by Email-ext plugin groovy templates.

Is there some way I can achieve this?

Parameter descriptions pic

1
  • 2
    Do the – three – downvoters mind to explain? Commented Oct 29, 2015 at 13:16

1 Answer 1

3

See Parameterized System Groovy script:

...

// get parameters
def parameters = build?.actions.find{ it instanceof ParametersAction }?.parameters
parameters.each {
   println "parameter ${it.name}:"
   println it.dump()
   println "-" * 80
}

...

Note: Since Actionable.getActions() is deprecated allActions should be used instead of actions.

Add:

   println "${it.description}"

and there you are.

Sign up to request clarification or add additional context in comments.

1 Comment

much appreciation could be done with an upvote. Please take a tour of StackOverflow

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.