@POST
  @Produces(APPLICATION_JSON)
  public Response post(
      @Context HttpServletRequest request,
      @QueryParam("repositoryId") Integer repositoryId,
      @QueryParam("pullRequestId") Long pullRequestId,
      @QueryParam("formIdentifier") final String formIdentifier)
      throws Exception {
    if (userManager.getRemoteUser(request) == null) {
      return status(UNAUTHORIZED).build();
    }

    final PrnfsSettings settings = getSettings();
    for (PrnfsNotification prnfsNotification : settings.getNotifications()) {
      PrnfsPullRequestAction pullRequestAction = PrnfsPullRequestAction.valueOf(BUTTON_TRIGGER);
      final PullRequest pullRequest = pullRequestService.getById(repositoryId, pullRequestId);
      Map<PrnfsVariable, Supplier<String>> variables = getVariables(settings, formIdentifier);
      PrnfsRenderer renderer =
          getRenderer(pullRequest, prnfsNotification, pullRequestAction, variables, request);
      if (prnfsPullRequestEventListener.notificationTriggeredByAction(
          prnfsNotification, pullRequestAction, renderer)) {
        prnfsPullRequestEventListener.notify(
            prnfsNotification, pullRequestAction, pullRequest, variables, renderer);
      }
    }
    return status(OK).build();
  }
 private boolean triggeredByAction(
     PrnfsSettings settings,
     PrnfsPullRequestAction pullRequestAction,
     PullRequest pullRequest,
     Map<PrnfsVariable, Supplier<String>> variables,
     HttpServletRequest request) {
   for (PrnfsNotification prnfsNotification : settings.getNotifications()) {
     PrnfsRenderer renderer =
         getRenderer(pullRequest, prnfsNotification, pullRequestAction, variables, request);
     if (prnfsPullRequestEventListener.notificationTriggeredByAction(
         prnfsNotification, pullRequestAction, renderer)) {
       return TRUE;
     }
   }
   return FALSE;
 }