Versions Compared

Key

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

...

Code Block
languagegroovy
def projectGroup = "Oracle Integrations"
return stgexec.getSnapshotProjects().findIndexOf { 
  projectGroup in it.getProjectGroupNames() 
} != -1

Create Comment through Webhook

Using Webhooks, we can create comment for multiple objects within FlexDeploy. We have a FlexDeploy function called createComment that takes the FdCommentDataObject as an argument.

FdCommentDataObject contains commentId, objectId, commentText, parentObjectId, objectType and versionNumber.

The below table will explain the ObjectTypes supported and inputs that needs to be passed based on the type.

Object Type

Object Id

Parent Object Id

PIPELINE_GATE_EXEC

Pipeline stage gate id

Pipeline exe id

PIPELINE_STEP_EXEC

Pipeline stage step id

Pipeline exe id

PIPELINE_GATE

Pipeline stage gate id

 

PIPELINE_STEP

Pipeline stage step id

 

RELEASE

Release definition id

 

WORKITEM

FlxWorkItem id

 

Below sample script creates a comment for pipeline gate execution object type.

Code Block
languagegroovy
import flexagon.fd.model2.pojo.*;

FdCommentDataObject dObj = new FdCommentDataObject();
dObj.setObjectId(<Pipeline stage gate id>);
dObj.setParentObjectId(<Pipeline exe id>);
dObj.setObjectType("PIPELINE_GATE_EXEC");
dObj.setCommentText("New comment in PIPELINE GATE EXECECUTION through webhook");
FdCommentDataObject result = FLEXDEPLOY.createComment(dObj);