enlivenhq / teamcity-slack

Configurable TeamCity notifier plugin for Slack.
137 stars 51 forks source link

Make it possible to customize (shorten) the message #23

Open alenkacz opened 8 years ago

alenkacz commented 8 years ago

For me, this is too verbose, I would prefer to be able to specify less verbose message (without the build, status, just the first line with a link).

If it makes sense to you, I can contribute.

Example of a Slack notification as it is done right now:

Project :: Deploy to Canary  #164 started
Build Status
Project
----------------
Project :: Deploy to Canary
Build
----------------
164
Status
----------------
started
cmakara commented 8 years ago

You can have an attachmentless version of notifications like this:

:x: Modules :: testmodule [feature/something] #4 failed: Exit code 255

To achieve this you have to set the teamcity.notification.slack.useAttachment internal property to false in TeamCity. For more info see this link.

eljobe commented 7 years ago

I'd like to submit a patch to this repo which adds another per-user property which allows the user to configure whether or not they include the "attachment" in their notifications. It could be a simple textual field which accepts "TRUE,FALSE,YES,NO,true,false,yes,no,True,False,Yes,No" and defaults to "True"

The display name could be "Verbose Messages" and it would have the effect of using a SlackWrapper constructed with "useAttachements" having the boolean version of whatever the user enters. Sure, the better thing would be to make a jsp snippet which uses a checkbox instead of a text field, but this is really easy to implement.

I'll put together a pull request if you're interested.

aclark09 commented 7 years ago

Sounds good to me, maybe one day we can get a checkbox there, but definitely not needed. It'll be nice to just get this feature out there for people to use.