alexkvak / teamcity-slack

TeamCity Slack plugin
MIT License
124 stars 23 forks source link

[Feature Request] Add support for conditions in Message Template #96

Open dinesh-it opened 4 years ago

dinesh-it commented 4 years ago

I want to construct a message template with github link to pull request/branch with the PR/branch name. Currently I was able to achieve this by constructing the template like

<{link}|{name} - {number}>
Github: <{%vcsroot.GitHub_MyProject.url%}/{%teamcity.build.branch%}|{%teamcity.pullRequest.title%}>
```Changes: {changes}```
Branch: {branch}
Status: {status}
{mentions} {reason}

But I have few issues with this

But I feel like I will be able to solve most of the above problems(at least hack around) if template supports if else elseif blocks. May be support for freemarker?

I know there are other forked repos with this feature, but I think this plugin works fine and no issues at all, just that a feature is missing.

alexkvak commented 4 years ago

Hi,

In the beginning of the plugin life I have some thoughts about condition templating but it seemed as complicated thing.

The time has come.

Could you share some links to the forks that have this feature?

dinesh-it commented 4 years ago

Hi, here is a commit - https://github.com/Ecwid/tcSlackBuildNotifier/commit/d54d7232dd60c55c7dddb20f59bf5813d4adb5b9

Seems not a fork just another variant of the plugin. Sorry about that.

This might be helpful - https://github.com/seratch/xsbt-scalag-plugin/blob/master/src/main/scala/scalag/freemarker.scala

avg07 commented 3 years ago

Hello. Sorry, what about if else elseif blocks support?