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

Allow Pipeline builds to use the same default templates as Freestyle

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • hipchat-plugin
    • None

      With classic Freestyle, I'm able to simply identify the "Notification Type" (build successful, build is unstable, etc. – there are 7 of them) but leave the message template blank, and the notifications sent are usefully structured HipChat cards, with a message (such as "MyJob #1234 Build successful after 5 sec (View build)") and a bottom section that shows counts of the successful tests, failed tests, skipped tests, and a link to the test report.

      However, in Pipeline, with the hipchatSend command, explicit message templates must be provided (the "message" parameter is required, and an error is raised if it's not provided). Moreover, it does not appear that there's a simple way to structure the message as a card, like the default Freestyle notifications.

      Is it feasible to have a Pipeline build do something like:

      hipchatSend notificationType: "build successful"

      And have that result in the same thing an equivalent Freestyle notification would? I get that Pipeline builds don't syntactically have the same notion of "post-build" events, but it seems like something that would hook into the default templates through some new parameter (like notificationType) could be called in the appropriate points in a Pipeline (at the beginning, if tests fail, etc.), and could also lay groundwork for using this in a Declarative Pipeline (which would simply configure the notification scenarios desired, equivalent to how a Freestyle build does).

            Unassigned Unassigned
            medianick Nick Jones
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: