tcWebHooks icon indicating copy to clipboard operation
tcWebHooks copied to clipboard

#substringBefore(${buildLog} and alternatives

Open fagionpw opened this issue 1 year ago • 1 comments

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

fagionpw avatar Jun 30 '23 13:06 fagionpw

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

netwolfuk avatar Jul 01 '23 20:07 netwolfuk