问题描述
您好,
我们的团队负责维护和维护内部错误和开发项目跟踪系统,该系统已存在近二十年,拥有数百名用户。 它包含其他传统跟踪系统的链接,
对我们的流程工作流程至关重要。  如果有的话,它不会很快被替换。 我们的任务是将此系统与TFS应用程序生命周期管理(ALM)系统连接起来。 在TFS中,我们已定制流程
模板以添加我们的内部字段。 当我们全部工作时,TFS数据库字段和内部数据库字段应始终与任何给定的TFS工作项同步。
实现这一长期目标,我们订阅服务器端WorkItemChangedEventHandler并使用
WorkItemChangedEvent 的SubscribedType。 此事件处理程序在保存工作项之后发生,可以很好地允许我们将更改的字段加载到发送回内部系统的消息队列中。 但是,我们还需要
才能订阅 WorkItemPreSaveEventHandler 。我们需要这样做有两个主要原因:
1:我们需要添加工作项字段的验证 - 使用我们的内部验证规则。我们不希望仅保存TFS工作项,以使消息队列因无效数据而无法更新旧系统。
这对我们非常关键。
2。可能需要为某些未更改的工作项字段指定不同的值,然后将其添加到ChangedFields列表中。一个特定的例子是我们有一个只读的"注释"。 TFS和遗留系统中的字段。 我们在
遗留系统中的约定是提供"附加备注"。文本框给用户。保存旧项目后,我们将其附加到现有Notes。即Notes现在变为Notes.value + "由用户XXX修改" +"timestamp"
+ textbox.text。 &NBSP; 由于< COPY />的限制,无法在流程模板中完成此类TFS备注自定义。 &NBSP;它可以在自定义控件中完成,目前看来这是我们唯一的选择。 我们的
其他选项是订阅< strong> WorkItemPreSaveEventHandler
,我们可以检测到TFS AppendNotes已更改,并对TFS备注进行更改。然后需要将TFS Notes添加到发送到消息队列的ChangedField列表中。
我们当前遇到的尝试使用WorkItemPreSaveEventHandler的问题是,没有似乎是实际的订阅类型 WorkItemPreSaveEvent !?没有事件,是否真的可以使用
WorkItemPreSaveEventHandler? 此外,甚至可以"添加"到PreSaveEvent中的ChangedFields列表?
我们对使用TFS的目标投入很大,但要取得成功,我们必须能够完成上述两项。 任何人都可以教育我们如何实现这些目标吗? 谢谢。
JMN
Hello,
Our team is responsible for the maintenance and upkeep of an in-house bug and development item tracking system that has existed for nearly two decades and which has hundreds of users. It has links to other legacy tracking systems that are critical to our process workflow. It's not going to be replaced any time soon, if ever. We are tasked with interfacing this system with the TFS Application Lifecycle Management (ALM) system. Within TFS, we have customized the process templates to add our in-house fields. When we get this all working, the TFS database fields and the in-house database fields should always be in sync for any given TFS work item.
To achieve this long-term goal, we subscribe to the server-side WorkItemChangedEventHandler and use the SubscribedType ofWorkItemChangedEvent. This event handler, which occurs AFTER the work item has been saved, works well to permit us to load up the changed fields into a message queue that is sent back to the in-house system. However, we also need to be able to subscribe to the WorkItemPreSaveEventHandler. We need to do that for two primary reasons:
1: We need to add validation of the work item fields - using our in-house validation rules. We don't want the TFS work item to be saved only to have the message queue fail to update the legacy system because of invalid data.This is very critical to us.
2. Some unchanged work item fields may need to be given a different value and then added to the ChangedFields list. One particular example is that we have a read-only "Notes" field in both the TFS and legacy system. Our convention in the legacy system is to provide an "Append Notes" textbox to the user. When the legacy item is saved, we Append this to the existing Notes. ie Notes now becomes Notes.value + "Modified by user XXX" + "timestamp" + textbox.text . This type of customization of the TFS Notes cannot be done in the process template due to the limitations of <COPY />. It could be done in a custom-control, and currently that appears to be our only option. Our other option is to subscribe to the WorkItemPreSaveEventHandler , where we can detect that the TFS AppendNotes has changed, and make the change to the TFS Notes. TFS Notes would then need to be added to the list of ChangedFields that are sent to the messsage queue.
The problem we are currently encountering with trying to use the WorkItemPreSaveEventHandler, is that there does not appear to be an actual Subscribed Type of WorkItemPreSaveEvent!? Without the event, is it truly possible to use the WorkItemPreSaveEventHandler? Also, is it even possible to "add" to the ChangedFields list in the PreSaveEvent?
We are heavily invested in our goal to use TFS, but to be successful, we have to be able to do the two items above. Can anyone educate us on how to achieve these goals? Thank you.
JMN
这篇关于有WorkItemPreSaveEvent吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!