Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
How do I get the Application Id from within a predicate editor?
-
I'm currently getting it for a Variable Setter using HttpContext.Current.Request.Url.AbsolutePath which equals http://localhost:81/applications/5/plans#step-4-1
In the Predicate Editor the url comes out as follows and has an application id of zero, which is not correct.
Product: BuildMaster
Version: 4.6.4
-
Predicates are not directly tied to applications anymore as of v4.3 because of global plans. However, if the plan is in a single application, you can use:
int id = int.Parse(HttpContext.Current.Request.QueryString["planActionGroupId"]); int applicationId = StoredProcs.Plans_GetPlanActionGroup(id) .Execute() .ApplicationDeploymentPlans .First() .Application_Id;
to get it.