Your question is vague. There are two ways to run groovy scripts. groovy on the console that launches groovy (.... / script)
Below is a list of node to set using groovy console
def item = hudson.model.Hudson.instance.getItem("createAndPublishSnapshot") def build = item.getLastBuild() println build.isInProgress() println build.getBuiltOn().getNodeName()
Jayan source share