Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You may want to change a package’s status to completed to indicate it successfully deployed to its final environment. This webhook handles changing the status for you using the Workflow Completed Event. You could also update the filter to only update the status for certain projects, releases, instances, etc. The listener also handles removing the package from its release first, as a package cannot be marked completed if it’s in an active release.

Expand
titleWebhook Listener
Code Block
languagegroovy
​def releaseName = EVENT.payload.release.releaseName
def projectId = EVENT.payload.project.projectId
def packageName = EVENT.payload.packageName

if (releaseName != null)
{
  FLEXDEPLOY.removeProjectsFromRelease(releaseName, [new ReleaseProjectsPojo(projectId, packageName, false)])
}

FLEXDEPLOY.updatePackageStatus(projectId, packageName, "COMPLETED")

...