Here you go a snippet of groovy I use to post System Message on Jenkins to post 
Common Maintenance Windows downtime info:

import hudson.model.*

def sysMessage = Hudson.instance.systemMessage


def newSysMessage = sysMessage ?: ""
…

cmwHeader = ""
if (cmwHeader != "") {
    newSysMessage = newSysMessage + cmwHeader
} else {
    newSysMessage = newSysMessage - CMW_NOTICE_PATTERN
}

Hudson.instance.setSystemMessage(newSysMessage)

-Indra

From: <[email protected]> on behalf of Richard Ginga 
<[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Wednesday, January 25, 2017 at 10:55 AM
To: "[email protected]" <[email protected]>
Subject: Re: groovy access to Jenkins description

more specifically, i want to change the System Message programmatically.

How can I do this?

On Wed, Jan 25, 2017 at 8:51 AM, Richard Ginga 
<[email protected]<mailto:[email protected]>> wrote:

I want to publish global information in the Jenkins main description using 
groovy. where is the class/method to do that?

thank you
--
Dick Ginga
Build Engineer
[email protected]<mailto:[email protected]>




--
Dick Ginga
Build Engineer
[email protected]<mailto:[email protected]>

--
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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAL3PpaXD3wbyB_EGMWbUo7akqve9T%2BnCFOhCnTJrJu7r5qCXUQ%40mail.gmail.com<https://groups.google.com/d/msgid/jenkinsci-users/CAL3PpaXD3wbyB_EGMWbUo7akqve9T%2BnCFOhCnTJrJu7r5qCXUQ%40mail.gmail.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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7B4E7B94-BC02-411D-833E-7BB91FF4AC80%40cisco.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to