tcplugins / tcWebHooks

WebHooks plugin for Teamcity. Supports many build states and payload formats.
https://netwolfuk.wordpress.com/category/teamcity/tcplugins/tcwebhooks/
155 stars 30 forks source link

#substringBefore(${buildLog} and alternatives #218

Open fagionpw opened 1 year ago

fagionpw commented 1 year ago

In the build log I have the message:

teamcity [URL'https://appcenter-filemanagement-distrib4ede6f06e.azure edge.net/e8b79f30--4220- 884a-5d4c5d5af9b3/build.apk?']

How to output the content of this message in json, for sending notifications in a slack?

substringBefore(${buildLog} doesn't work

netwolfuk commented 1 year ago

Hi @fagionpw.

I don't understand what you want to achieve. The ##teamcity service message doesn't appear to be related to the substring code in your second paragraph.

There is a substr command in velocity already..

#substr(text, startIndex, endIndex, minLength) - Returns the sub string of text starting at startIndex and finishing at endIndex, if text is longer than minLength.

See https://github.com/tcplugins/tcWebHooks/wiki/WebHook-Templates-%3A-The-Velocity-Templating-Engine