Having a date parameter for flows
Hello,
I a new TeamCity user. I would like to create a date parameter, in order to choose a date and a time within a day and format it as a timestamp.
The ideal solution would be to have like a calendar in order to chose a date.
I don't understand why there isn't a date parameter by default.
I searched on the web and people are talking about the ‘groovy plug’ : http://confluence.jetbrains.net/display/TW/Groovy+plug
But I can't access it or find it as official plugin.
Is there any solution to have this ?
Please sign in to leave a comment.
Could you provide a more detailed explanation of what you want to achieve? What is your scenario?
Best regards,
Anton
Hello Anton,
We've encountered a need within our jobs where we must select a specific date and time to timeshift a sandbox effectively. To streamline this process, we are exploring the possibility of integrating a calendar picker and a time picker into our workflow. Our goal is to format the selected date and time into an Epoch Unix Timestamp.
Could you please advise if such functionality is available within TeamCity, or if there are any recommended plugins or solutions to achieve this?
Thank you for your assistance.
I assume that you want it as a build parameter (https://www.jetbrains.com/help/teamcity/2024.03/configuring-build-parameters.html) to use this value in the build steps. Is this correct?
The supported types of build parameters are described here: https://www.jetbrains.com/help/teamcity/2024.03/typed-parameters.html#How+to+Create+a+New+Parameter. Unfortunately, the date and time is not a supported build parameter type, and there is no picker available.
The best approximation I can think of is to set the parameter to text with the regular expression and then convert it to the timestamp in the build step.
Please let me know if this answers your question.
Best regards,
Anton
Hello Anton,
Thank you for your prompt response.
Indeed, we aim to utilize this feature as a build parameter and subsequently employ its value within our build steps.
Expanding on our query, we're interested in exploring avenues for creating more customized forms. Could you provide insights into whether plugins or alternative methods could facilitate this?
We're particularly intrigued by the Groovy plug-in but have encountered difficulty accessing it via http://confluence.jetbrains.net/display/TW/Groovy+plug.
Thanks
I have confirmed that this Groovy plug should meet your requirements. You can download it from our public open-source server as an artifact from the latest successful build: https://teamcity.jetbrains.com/buildConfiguration/TeamCityPluginsByJetBrains_GroovyPlug_GroovyPlugTrunkAgainstTeamCity20171.
Best regards,
Anton
Thanks Anton,
We will have a look.
David