How to add a field to TFS workitem - c#

I'm a new user to TFS
I would like to add a custom field to a work item in a project in my project collection.
My expectation is to add a custom field("BizID") to a work item "task" from **c# code behind.**
I would like to know what all are possible ways to add a custom field to a work item?
P.S: I dont need a Process Template interruption to do this and Also not using WIT.
Some references will help. Thanks in advance.

At present time, in order to add a field to a process template in on-premise TFS, you need to modify the process template XML. There's no way around it.
You may be able to avoid using a process template customization by using some combination of custom backlog columns and tags, however. It depends on the data you want to capture.

As Daniel mentioned, modify the process template is the only way to modify a work item type.
Besides modifying work item type definition, you can also download and install TFS Power Tool, which will simplify the process of add a field. TFS Power Tool provides a UI to add fields. You can check this tool and follow this blog:
http://blog.infostructure.co.nz/2013/05/how-to-addedit-field-in-team-foundation.html

Related

Update app.config file after installer upgrade

I'm currently working on a Microsft Word Application-Level Add-in using C#. My application contains an app.config file. In this file I save user-settings (userSettings-Section) and some data defined by a custom ConfigurationSection. The data stored inside of custom ConfigurationSection is also user-specific.
I access the user-settings as follows:
Properties.Settings.Default.MyUserSetting
The custom ConfigurationSection I'm using like:
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal)
.GetSection("MyCustomConfigurationSection")
My questions are:
Do I even use the app.config the "correct" way? (I know that there is probably not only one correct way, but is "my way" one of these?)
Which ConfigurationUserLevel does Propeties.Settings.Default use? Is there a way of setting/changing it?
And Most importantly: Is there a way to automatically keep the user-specific settings during an upgrade of my application, but at the same time add newly created settings?
I deploy my Add-in using an installer built with WiX. At the moment I use CustomActions, which manually insert code for each added/removed/changed setting. But I was wondering whether there is a built-in way of doing this.
I did some researches the whole day now and I think I can answer my questions for myself:
Q: Which ConfigurationUserLevel does Propeties.Settings.Default use? Is there a way of setting/changing it?
A: It seems that Propeties.Settings.Default use ConfigurationUserLevel.PerUserRoamingAndLocal, what sounds logical as they only contain userSettings... I don't know whether it is possible to change it, but for me it is not necessary.
Q: Is there a way to automatically keep the user-specific settings during an upgrade of my application, but at the same time add newly created settings?
A: I found out that there is an Upgrade()-Method in Settings which should take care of copying user settings between an older version of the product and the new one. For more information see http://ngpixel.com/2011/05/05/c-keep-user-settings-between-versions/. I must confess that I haven't had occasion to test it, since I have no permissions to build the installer, but I will rely on it. I will come back to this post after I tested my solution.
Furthermore I am not using a custom ConfigurationSection any more. Instead I derive from System.Configuration.ApplicationSettingsBase, which means that I am able to handle the custom data exactly like the Properties.Settings, including the Upgrade()-Method. See this post for more information about how to use it.
Hope this helps somebody.

What's the best way to create a replication/load balancing module?

We have a sharepoint doucment library, the site consist media files(like images, word document, .psd file) and then we have a local CME (Alterian) which can be integrated to the SharePoint library in order to share the document library but the site needs to be on http// not an https//, coincidentally current sharepoint site is on https//, so we need to figure out a way/write a module which will work as a scheduled job (possibly using SPJobDefination class) and check on https// site for recently modified/added or deleted documents/records and then will copy them/normalize them to a dev site (hosted on http//, replica of the production https// site).
Experts please share your view's to proceed with a best approach to make this happen. (At an initial stage I'll have to copy over all the existing meta-data from the current https// site aswell)
Thanks a lot in advance for the time.
I would use event handlers on the https document library. Please see the SPItemEventReceiver.ItemAdded Method and SPItemEventReceiver.ItemUpdated Method.
So, every time you will add or modify an item, the code inside the methods is triggered. Inside the code, you may take the library document and copy it to the http site.
Regarding the existing items, you could write a simple console application which will copy the items from one list to the other.
Make sure that you make use of the SPListItem.SystemUpdate Method.
Also, the following excerpt from an answer to the question Moving Documents from library to library deletes version history, how do you retain it? could be helpful for starting:
(...) We can get the “SPFile” and the “SPFileVersion” objects from the
original library and add them to another library one by one. After
copying a file or version, get the original custom property form the
source file or version and use the “SPListItem.SystemUpdate(false)”
method to update the target file or version. This workaround can
persist most of the properties except the “modified time” or “modified
by” field. (...)

Is it good practise to remove Id tags from Controls that I don't reference in Code Behind

I'm wondering about a feature in Visual Studio. Personally it bugs me when I open a solution someone else has been working on and it's full of Controls with Ids like "label27" "textbox3" etc.
One of the first things I do is either rename them or remove them if they are never referenced in code behind (as is usually the case with the labels).
But I was just wondering why Visual Studio defaults them such meaningless values, then I started thinking if maybe it is better practise to have something in the Id field rather than blank it.
Of course the best situation is to give them all sensible names, but if I come across a project full of those auto generated Ids, am I doing the author a favour by removing them to "clean up" the solution?
I used to think so, but wouldn't the default for dragging and dropping or copying and pasting controls in be without an Id?
I think there's no reason to keep IDs like that. More ids => more html => more size. I know, this may be not significant, but why to plague your source code with something you don't want and don't really need?
If you don't like VS's default behavior, you can disable "auto id-ing" via settings:
Tools -> Options -> (Show all settings) -> Text editor -> HTML -> Miscellaneous
VS will assign ID automatically to the controls you haven't provide them to. But if you are pasting some code with controls without IDs, VS will add autogenerated names to them.
So, Microsoft thinks that all the controls should have uique IDs. And you should provide such IDs. But if you really don't need them, so simply remove ID to adjust readability to your code.
The main point is this should be for all controls accross the project, and it should be easy to read "clean" code.

Extending TFS to include custom fields in work items

We have a need within our organization to add a field to Work Items that has traceability throughout TFS 2010 source control. We use ticket numbers to identify work items internally and would like to associate a TFS work item with our internal ticket numbers and then be able to run reports to gather information such as:
Which work item was associated with ticket #12345
What ticket numbers were included in a particular release branch?
Etc...
All of this starts with extending the TFS work item UI to include our custom field. Not having done any extending of TFS before, can anyone point me in the right direction with advice, URLs, tutorials, etc?
Thanks!
I have not tried this myself, but this post may get you started:
How to add a Custom Field to an existing Work Item Type in TFS 2010 Process Template (MSF for Agile 5.0)

areanavigationsettings.aspx Programmatically

I've been messing with SPNavigationProvider, PublishingWebs, and etc for the past few days and I can not figure out how to move a node in /_layouts/areanavigationsettings.aspx programmatically.
The node I need to move is in the list of the Global Navigation, but when I query the SPPublihsingWeb.GlobalNavigationNodes it is not listed. When I call IncludeInNavigation() on the web I need in GlobalNavigationNodes, there is no change.
I'm doing this through a Feature Activation if that makes any difference.
I appreciate any help.
Thanks.
You probably want to do similar things I just did: Deploy custom Navigation / SiteMap via Feature?.
Instead of using the Publishing Site, why not use the SPWeb.Navigation?
Check out the following MSDN entry on Adding Links through Object Model - just iterate over the Children of SPWeb.Navigation and you will find your link and will be able to modify it.

Categories