Reputation: 13
I am working on intelliJ plugin to create check-in policy: I need to know how many check-in policies are applied on particular branch. I am using TFS JAVA SDK for retrieving the check-in policy configuration. But it is returning empty. Please refer my another issue at "PolicyDefinition result return empty collection using Java SDK of TFS 2015 "tp.getCheckinPolicies()" or "vcc.getCheckinPoliciesForServerPaths()""
Then I tried using REST API to understand if I can get policy definition using REST URL.
Constructing URL as given below as per example available on Microsoft blog “https://www.visualstudio.com/en-us/docs/integrate/api/policy/configurations”:
GET https://{instance}/defaultcollection/{project}/_apis/policy/configurations?api-version={version}[&$top={top}&$skip={skip}]
My URL: https://TFSServer/tfs/PC1/CP/_apis/policy/configurations?api-version=2.0-preview
This return empty collection. {"count":0,"value":[]}
I have on premise TFS and it is configured with TFVC services not GIT.
I have following doubts:
Upvotes: 0
Views: 403
Reputation: 31023
Java SDK you used in your previous case is correct, but it can only get check-in policies in Java based tools, such as Team Explorer Everywhere. You can't get the check-in policies that added in VS with Java SDK.
Upvotes: 0
Reputation: 59020
Check-in policies and branch policies are totally different, unrelated things.
Check-in policies are for TFVC and only TFVC. Branch policies are for Git and only Git.
The API you're using is for branch policies.
As far as I recall, there's no API for check-in policies. This goes for both the old-style SOAP APIs and the new-style REST APIs.
Upvotes: 0