0

So we are transitioning to VSTS from an on-premises TFS and what I'd like to do, for one particular project, is be able to validate some fields in VSTS when a user submits a User Story.

What I have so far is that I've inherited a new process from the Agile process (let's call it my-agile for arguments sake), then edited the User Story in that new process to add some new fields (let's say one of them is called Base URL). Base URL is a "Text (single line)" and is required, but VSTS seems to have even less options to validate than TFS did. I'd like to be able to test if the URL matches a simple regex (to check that it actually is a URL) and if possible, I'd like to be able to check the domain against other user stories to look catch duplicates.

Is there a way to do this? I was looking at extensions for example here: https://learn.microsoft.com/en-us/vsts/extend/get-started/node but that will add something to all of VSTS and I'd like to have something attached only to one project. I was thinking I could either:

1) Create an extension (preferably only active for one project) that would provide an interface to post the user stories but would include the validation I need before the user story is actually posted

2) Possibly use service hooks (https://learn.microsoft.com/en-us/vsts/extend/develop/add-service-hook) somehow? To catch when a user story is posted and potentially flag (or tag) it based on some criteria?

I think is it's possible #2 might be preferable and the least intrusive, if I could tag a user story as "potential dupe" and link it to another story that would alert the developers and allow them to act appropriately. But at the moment I'm not even sure if that's something that is possible.

Matt Burland
  • 44,552
  • 18
  • 99
  • 171

1 Answers1

1

Regarding #2, it is impossible to achieve your requirement, there isn’t the work item updating event.

Regarding #1, the extension will apply to all team projects and there isn’t the feature to active for one project, but you can check current team project in the code to decide whether show content.

Official article about adding a custom control to work item form

An sample of custom control extension: vsts-extension-multivalue-control

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53