Skip to content

Commit

Permalink
Change hard-coded team project name to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts2013 committed Dec 18, 2015
1 parent 2571167 commit 4f3ef66
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/main/resources/tfsdk/CreateWorkItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
print "No server provided."
sys.exit(1)

# original
# TFS_SERVER_URL = 'http://54.186.219.167:8080/tfs'
# COLLECTION_URL = 'http://54.186.219.167:8080/tfs/DemoCollection-2'

if username is None:
username = tfsServer['username']
if password is None:
Expand All @@ -39,17 +35,15 @@
# set up tfs
tpc = TFSTeamProjectCollection(URIUtils.newURI(tfsAPIUrl), credentials)

print "\r\rprojectName name: %s \r" % (projectName) # "DemoTeamProject-2"
#NO: project = tpc.getWorkItemClient().getProjects().get("%s" % projectName)
#NO: project = tpc.getWorkItemClient().getProjects().get(projectName)
project = tpc.getWorkItemClient().getProjects().get("DemoTeamProject-2")
print "\r\rprojectName name: %s \r" % (projectName)
project = tpc.getWorkItemClient().getProjects().get(projectName)
print "\r\r created project object"

# Find the work item type matching the specified name.
bugWorkItemType = project.getWorkItemTypes().get(workItemType) # get("Bug")
bugWorkItemType = project.getWorkItemTypes().get(workItemType) # e.g., get("Bug")

# Create a new work item of the specified type.
newWorkItem = project.getWorkItemClient().newWorkItem(bugWorkItemType) # Bug
newWorkItem = project.getWorkItemClient().newWorkItem(bugWorkItemType) # e.g., Bug

# Set the title on the work item.
newWorkItem.setTitle(workItemTitle)
Expand Down

0 comments on commit 4f3ef66

Please sign in to comment.