Boris Pevzner
Boris Pevzner

Reputation: 11

MS TFS 2015 mandatory linking between work items

In TFS there is possibility to link work items between each other - for example PBIs to Features, or Impediments. Does anybody know - how to make these links mandatory, so for example it will be not possible to save PBI if it was not linked to feature?

I'm using TFS2015 on premises.

Upvotes: 1

Views: 262

Answers (1)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30372

According to the request, you need to set the Required rule for the links control, but as far as I know the default Links control not support Required rule.

So, as workaround you can add a hidden field, then set 'Required' rule for the hidden field, thus it will prompt that you need to link to Features or other workitems when you save the PBI without any linked workitems.

Here is the example. You could add field called Links, which is hidden field and it would have the following syntax:

<FIELD  name="Links" refname="lc.RelatedWorkItems" type="Integer">
    <WHEN field="System.RelatedLinkCount" value="0">
       <REQUIRED />
    </WHEN>
    <WHENNOT value="0" field="System.RelatedLinkCount">
       <DEFAULT from="field" field="System.RelatedLinkCount" />
    </WHENNOT>
    <HELPTEXT>This is a hidden/internal field that will help to force the user to associate the work items.</HELPTEXT>
</FIELD>

enter image description here

Upvotes: 1

Related Questions