Versions Compared

Key

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

...

Code Block
languagegroovy
return "SUCCESS".equals(EVENT.payload.executionStatus) && "PRODUCTION".equals(EVENT.payload.environment.environmentCode) && EVENT.payload.packageName != null

Set the Assignee of the Work Item on Work Item Creation

To prevent user error when creating a work item, you set the default Assignee for the Work Item to the user who created the work item if it was not set. This webhook will only set the assignee at creation time using the Work Item Created Event.

Webhook Listener

Code Block
languagegroovy
FlxWorkItemDataObject workItem = FLEXDEPLOY.findWorkItemByNumber(EVENT.payload.workItemNumber)

// check if the assignee is not already set
if (!workItem.getAssignee()?.trim())
{
  FLEXDEPLOY.updateWorkItemAssignee(EVENT.payload.workItemNumber, EVENT.payload.createdBy)
}