index > Visual Studio Team System - General > Unable to associate a workitem programatically

Unable to associate a workitem programatically


Hi,

I am new to TFS & so I am sorry if I am asking a very obvious question...

I am trying to programaticaly check in a file. The check in policy that's been established is such that every check in is to be associated with a workitem. I am not sure how to do this in my code

I guess I need to have a WorkItemType object which will be a parameter to the WorkItem object , which I can again use in the WorkItemCheckinInfo.

The problem is I dont know how to create a WorkItemType object. I will have a workitem already created in VSTS & I just need to associate my check in with that workitem ID

WorkItemCheckinInfo[] workItemInfo = new WorkItemCheckinInfo[1];

WorkItemType type = new WorkItemType(); //?? I dont know how to do this...There is no constructor.so how do i get a type

WorkItem pub_subWorkItem = new WorkItem(type);

workItemInfo[0] = new WorkItemCheckinInfo(pub_subWorkItem, WorkItemCheckinAction.Associate);

I will use the 'workItemInfo' in when i call the CheckIn() method as follows:

destworkspace.CheckIn(destpendingchanges, "Checked in at: "+ DateTime.Now.ToString (),null,workItemInfo,null);

Can somone pls help me out?

Much Thanks in advance,

~ramya

RamyaP

Ramya, you can get instance of workitemtype from workitemstore. Below is a sample:

Console

Naren Datha - MSFT

Thanks Naren. That was extremly useful..

Much Regards,

Ramya

RamyaP
reply 3

You can use google to search for other answers

 

More Articles

VS 2005 RTM compatible with VSTS Beta3 Client
Errors with all reports on Project Portal page
Problems after installing the team foundation system on clean win...
Code Coverage
WSS Error on home page viewing reports
I do not have permission to view the sharepoint webpage
Go Live License
How to give thinktime option for a mixed test proportion in VSTS
Help --- TF30162: Task "SharePointPortal" from Group &q...
Setup project help
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Team system for smal Team
Team System BOOKS /Trainings
VSTS July CTP = Which build of Yukon is …
Visual Studio Beta 2 - Errors related to…
location of servers to which a client ca…
TeamSystem and Visual Studio 2003
VS 2005 compatibility with SourceSafe 6.0?
Developer Express Edition + Team Suite o…
VS 2005 RTM and .NET Framework 3.0
Where to post questions/comments about...
how to start a project with MS Team System
What is a minimum install to get code co…
Web Deployment Projects, WAP, and Releas…
Relative paths for Deployment Items
VSTS and Speed. International team.

Hot Articles

Looking for a good online book to convin…
Search Engine at Project Portal not runn…
please help
Canceled book purchase - Introducing Mic…
Adopting Team System
Site Portal Recycle Bin?????
How to do a forward merge?
Upgrade path Confirmation required
Upgrading TFS trial edition
How to Export Work Item History?
Team Suite or Professional?
Single PC - Team Build Error - Build Mac…
Excel workItems menu doesn't appear
Scripted demo exposes stove-pipe-tools s…
Creating different versions of the same …

Recommend Articles

devenv.com broken in beta 2?
Tasks in the 'Tasks List' in the project…
Install VS RC1 on Single Team System Ser…
Error in Project
VSTS working with Perforce...
What's the password for hands-on VSTE DV…
Team explorer licensing
"User Task" in the Task List
TeamSystem and Visual Studio 2003
News Groups
Beta 2 Install is REQUIRING VS 2003 Be U…
Team System WITHOUT .NET
Can we switch licenses between VS 2005 T…
What is Team System?
Compatibility of Visual Studio.NET 2005 …