Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dinesh-it opened this issue Feb 14, 2020 · 3 comments
Open

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

dinesh-it opened this issue Feb 14, 2020 · 3 comments

Comments

@dinesh-it
Copy link

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

  • The URL constructed for master builds are wrong because {%teamcity.build.branch%} will be master but I need tree/master it is pull/1 when the build starts for a pull request and so works fine for PR but not for master.
  • {changes} is empty when the build starts
  • {%teamcity.pullRequest.title%} is empty when build runs against a branch

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
Copy link
Owner

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
Copy link
Author

Hi, here is a commit - Ecwid/tcSlackBuildNotifier@d54d723

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
Copy link

avg07 commented Jan 11, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants