From 4976182c9df4e2599fcead051a54c397818abc6e Mon Sep 17 00:00:00 2001 From: Tom Batchelor Date: Wed, 28 Oct 2015 11:21:20 -0400 Subject: [PATCH] Resolved issue getting TFS2015 CI --- README.md | 2 +- src/main/resources/tfsrest/CreateWorkItem.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dcd3fd9..17609d6 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ This plugin offers an interface from XL Release to Team Foundation Server via th The functionality will be enriched with additional Work Item fields as specific needs materialize. -Note: HttpRequest.py in older versions of XL Release must be enhanced to support the HTTP PATCH method. See https://github.com/droberts2013/xl-release/server/src/main/resources/pythonutil/HttpRequest.py if necessary. Place this custom file in /ext/pythonutil. +Note: HttpRequest.py in older versions of XL Release must be enhanced to support the HTTP PATCH method. See [droberts2013/xl-release/server/src/main/resources/pythonutil/HttpRequest.py](https://github.com/droberts2013/xl-release/blob/afc1468c9fde54d03f046211fbc1b9e1068106c1/server/src/main/resources/pythonutil/HttpRequest.py) if necessary. Place this custom file in /ext/pythonutil. ## TFS SDK diff --git a/src/main/resources/tfsrest/CreateWorkItem.py b/src/main/resources/tfsrest/CreateWorkItem.py index ffdb2a2..f8bdc0d 100644 --- a/src/main/resources/tfsrest/CreateWorkItem.py +++ b/src/main/resources/tfsrest/CreateWorkItem.py @@ -9,15 +9,15 @@ print "Executing CreateWorkItem.py ver 2015Jun28-1" -if tfs2015Server is None: +if tfsServer is None: print "No server provided" sys.exit(1) contentType = 'application/json-patch+json' -request = HttpRequest(tfs2015Server) +request = HttpRequest(tfsServer) content = '[{"path": "/fields/System.Title", "value": "%s", "op": "add"}]' % workItemTitle -response = request.patch('%s/%s/_apis/wit/workitems/$%s?api-version=1.0' % (collection, teamProject, workItemType), content, contentType=contentType) +response = request.patch('tfs/%s/%s/_apis/wit/workitems/$%s?api-version=1.0' % (collectionName, teamProjectName, workItemType), content, contentType=contentType) httpStatusCode = response.status print httpStatusCode print response.response