ADDING value to a String/HTML field instead of COPY
-
Thursday, November 04, 2010 9:09 AM
Hello,
I am adding some rules to the work items in TFS 2010.
I want to add value to a field, lets say it is an HTML field. What I want to do is that if the value of the field is:
"Somo value"
then I add a rule for the priority change, to COPY "some other value" in that HTML field when it happens. Then the value of the field will be:
"some other value".
But what I want to have now is:
"Some value
some other value"
So, what I want is to concatenate two strings, adding value to the field when something happens, without loosing the old value. Is it possible? Is there any way to do that?
Let me know if the example is not clear enough.
Regards and thanks in advance.
Leo
All Replies
-
Wednesday, November 10, 2010 7:21 AM
In my thought, it is impossible to do just with Rule.
You may create Work Item Changed Event catch web service (or WCF).
-
Wednesday, November 10, 2010 10:15 AM
Sorry, but I didn't understand the second part of the answer. What is it that you suggest I can do?
I don't know much about the web services TFS can offer, so it would be good if you can explain it to me or leave any link with information.
Thank you for your answer.
-
Friday, March 23, 2012 2:28 PMI would also like a more detailed answer to how this would be achievable. I am trying to concatenate strings from two fields into a HTML field. I have not found a way to do this conventionally.
-
Friday, May 04, 2012 8:21 PM
Hi Leo,
You can implement the logic in a custom control. For example:
Override the WorkItemDatasource method and add an event for all workitem fields when its value changes
m_workItem.FieldChanged += new WorkItemFieldChangeEventHandler(OnFieldChanged);
then implement in the event the logic you need:
protected virtual void OnFieldChanged(object sender, WorkItemEventArgs e) { if (null != m_workItem) { if (e.Field.ReferenceName == "MyFieldReferenceName") //Do something ... } }I hope it helps

