Modify the Default Build Name and Build Number - Scripted Pipeline Syntax

JFrog Integrations Documentation

Content Type

You can modify the default build name and build number set by Jenkins. Here's how you do it:

def buildInfo = Artifactory.newBuildInfo() = 'super-frog'
buildInfo.number = 'v1.2.3'
server.publishBuildInfo buildInfo


If you're setting the build name or number as shown above, it is important to do so before you're using this buildInfo instance for uploading files.

Here's the reason for this: The server.upload method also tags the uploaded files with the build name and build number (using the and build.number properties). Setting a new build name or number after the files are already uploaded to Artifactory, will not update the properties attached to the files.