Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62408

Stash Pullrequest Builder custom comments in pipeline




      Although pipeline support for this plugin is officially experimental, the trigger seems to work fine, and the only major missing feature I've found is the ability to customize the comment left on pull requests. I would love to see this available as a pipeline step. Potentially something like

      stashPostBuildComment(successfulComment: 'it worked', failedComment: 'it didnt')

      or even just one argument that sets the custom text, without having to specify success/fail:

      try {
          // build something ...
          stashPostBuildComment 'it worked'
      } catch (err) {
          stashPostBuildComment 'it didnt'

      It feels like it should be possible to make the existing StashPostBuildComment class compatible with pipelines, but no idea how to actually go about doing it.

      As a workaround, I'm able to post a 2nd comment in a PR with something like

      import stashpullrequestbuilder.stashpullrequestbuilder.stash.StashApiClient
      StashApiClient stash = new StashApiClient(
          'username', 'password',
          'myProject', 'myRepo',
      stash.postPullRequestComment(pullRequestId, 'hello!')

      but it is sure feels clunky and doesn't work in the groovy sandbox without admin approval.

      I would love to know if there are better workarounds, or something simple I could do to help make this change (despite being a complete newbie in plugin development).



          gpaciga Gregory Paciga created issue -
          gpaciga Gregory Paciga made changes -
          Field Original Value New Value
          Labels pipe plugin
          gpaciga Gregory Paciga made changes -
          Labels pipe plugin plugin
          jbochenski Jakub Bochenski made changes -
          Assignee Jakub Bochenski [ jbochenski ]


            Unassigned Unassigned
            gpaciga Gregory Paciga
            0 Vote for this issue
            2 Start watching this issue