How do I find project deployment location using API ? Is it possible?



Thanks for reaching out. In most cases the deployment location is a combination of lots of variables generated at deployment time, and most times they even defer from target to target. So the general answer would be: Cannot be done, the only ways to get this info would be:

  1. Parsing the log file. Very painful.
  2. Looking at each machine’s DeploymentJournal.xml. Also not too optimal as you’ll need access to each machine.

Now, all that said, if you are not using a dynamic deployment location, and instead you are passing a fixed value declared through a project variable. Then you could get the release’s variable snapshot and get the value from there. To do this you’ll need to get the release through the API (i.e /api/releases/Releases-4870) and then check the Links.ProjectVariableSnapshot property of it as shown on the below gist.

Hope that helps,

Thank you for your reply…
So what I have is a bunch of settings UNRELATED to deployment location and they are defined in root… any way that I can get deployment locations in this scenario ?

I’m not sure I’m understanding your last question. You want to get the values of those variables in that last screenshot using the API?

Yes.I do.I don’t know how. I will be grateful if you tell me how ? All the samples I saw were PROJECT variables none were about my structure.

Also, I was wondering if this structure help me to get deployment location any easier way that you can recommend ?
Thank you.

This script should help you get started:

It’ll return something like this for every variable

Id          : 03f923e8-be7d-9e16-3889-3dc39d8141cf
Name        : DatabaseServer
Value       : PSQL01
Scope       : @{Environment=System.Object[]}
IsEditable  : True
Prompt      : 
Type        : String
IsSensitive : False