Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tfs/src/main/java/hudson/plugins/tfs/util/TeamRestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public void addHyperlinkToWorkItem(final int workItemId, final String hyperlink)

public TeamGitStatus addPullRequestStatus(final PullRequestMergeCommitCreatedEventArgs args, final TeamGitStatus status) throws IOException {

final QueryString qs = new QueryString(API_VERSION, "4.1-preview");
final QueryString qs = new QueryString(API_VERSION, "3.0-preview.1");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a released version? The APIs are on 5.0 now. It seems like 3.0 should not need the preview tag.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the documentation, the commit status API request is no longer in preview but the pull request status still is. However, for compatibility with TFS 2017 and 2018, "3.0-preview.1" looks to be the only supported version. Any other version gives a "404 - Not Found" HTTP response.

final URI requestUri = UriHelper.join(
collectionUri, args.projectId,
"_apis", "git",
Expand All @@ -294,7 +294,7 @@ public TeamGitStatus addPullRequestStatus(final PullRequestMergeCommitCreatedEve

public TeamGitStatus addPullRequestIterationStatus(final PullRequestMergeCommitCreatedEventArgs args, final TeamGitStatus status) throws IOException {

final QueryString qs = new QueryString(API_VERSION, "4.1-preview");
final QueryString qs = new QueryString(API_VERSION, "3.0-preview.1");
final URI requestUri = UriHelper.join(
collectionUri, args.projectId,
"_apis", "git",
Expand Down