huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Trigger build with same definition name but different folder #224

Closed Dimigergo closed 1 year ago

Dimigergo commented 1 year ago

Hello!

I have a build definition whitch use this extension to start a build definition. The problem is that I use two build definition with the same name but different folder. The Trigger Build extension always starts the release2 folder MLR.MoLaRi.HQ.HQService build. Can I use somehow the folder to point the exact build definition? I cannot use the branchname for this, because the two build definition absolutely different tasks, but use common task groups which use (Build.DefinitionName) variable inside (f.e.: the project name and the folder is that name). Thats why the two build definition name is the same. We have 128 projects with installers, so basycally more than 200 build definition, so I prefer to use the $(Build.DefinitionName) variable in it instead of rename the build definition to unique.

So the simpliest solution for me if I can specify the folder of the build definition. F.e.: release4/MLR.MoLaRi.HQ.HQService

2022_10_10_11_05_07_MoLaRi_Release_release4_Azure_DevOps_Server

2022_10_10_10_50_51_Pipelines_All

Thanks in advance!

huserben commented 1 year ago

Hi @Dimigergo

thanks for raising your question. I'm not sure how the folder name is returned from the API, thus it would require some investment and adjustment of the task (which currently is not realistic from my side as I don't have much time).

I see your problem though and there might be another way. It's not as "nice" to read it, but you could specify the Definition ID instead of the name. In order to increase readability you could also add a variable that maps the definition name to the actual ID.

You can find the ID by opening the respective build definition and see what "number" is in the URL: Definition ID

Please let me know if this would be a viable option for you.

Dimigergo commented 1 year ago

Thanks for the response! Tomorrow, I will try, your suggestion absolutely good for us. I saw that can enter the name or the ID, but didn`t know where can I find the ID. :)

So thanks, tomorrow will let you know if it works.

huserben commented 1 year ago

Yes please let me know, if not I'm happy to support.

Dimigergo commented 1 year ago

It's perfect, thank you for your suggestion!

huserben commented 1 year ago

Glad to hear that it worked!