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

Stash Pullrequest Builder custom comments in pipeline

XMLWordPrintable

      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(
          'https://bitbucket.example.com/',
          'username', 'password',
          'myProject', 'myRepo',
          false
      )
      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).

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

              Created:
              Updated: