You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TFS 2015中已解决工作项能否阻止代码签入关联及后续变更?

Answers to Your TFS 2015 Workflow Questions

Great questions! Let’s walk through practical solutions for both scenarios in your TFS 2015 and Visual Studio 2015 setup:

1. Blocking Code Check-ins Linked to 'Resolved' Work Items

Absolutely, you can enforce this using TFS’s built-in check-in policies. Here’s how to set it up step by step:

  • Create a targeted work item query:
    Build a query that filters for work items not in the Resolved state (adjust the state name to match your exact workflow terminology). For example, use the filter State <> Resolved. Save this query in a shared team location so everyone can access it.

  • Configure the Work Items check-in policy:
    Head to your team project settings → Source Control → Check-in Policies. Add the Work Items policy, then set it to require that all linked work items match your custom query.

  • Validate the policy:
    From now on, anyone trying to check in code linked to a Resolved work item will get a block from TFS, forcing them to use an active (non-Resolved) work item instead.

Pro tip: Keep the query updated if you ever modify your work item state names, and double-check that all team members have access to the query file.

2. Locking Work Items After QA Approval

To prevent changes once a work item gets QA sign-off, you’ll need to customize your work item type (WIT) definition and tweak permissions. Here are two reliable approaches:

Option 1: State Transitions + Read-Only Field Rules

  • Add a "QA Approved" final state:
    If your workflow doesn’t already include one, use the Process Editor (part of the TFS 2015 Power Tools for Visual Studio 2015) to add a QA Approved state to your WIT.
  • Set read-only rules:
    In the WIT definition, add a rule that triggers when the work item transitions to QA Approved: mark all editable fields (like Description, Assigned To, or custom fields) as read-only. This ensures no one can modify the work item after approval.

Option 2: Permission-Based Locking

  • Restrict edit access for the approved state:
    Go to your team project’s security settings, navigate to the relevant work item node (or specific WIT type), and adjust permissions for user groups (e.g., Developers):
    • Deny the Edit work items in this node permission specifically for work items in the QA Approved state.
    • Leave QA/Admin groups with edit access if you need to allow rare, controlled exceptions.

Either method will ensure that once a work item is QA-approved, it stays untouched unless explicitly allowed.

内容的提问来源于stack exchange,提问作者Anuj

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:20:17