MicrosoftPremier / VstsExtensions

Documentation and issue tracking for Microsoft Premier Services Visual Studio Team Services Extensions
MIT License
56 stars 14 forks source link

Create Work Item: Specify values for duplicate key fields like State<>'Done' #211

Closed MichelJansson closed 11 months ago

MichelJansson commented 1 year ago

Thanks for creating this extension. We are looking to use it to create bugs if scanner finds any issues. Everything works nicely to create the work item, except that I cannot figure out how to setup the duplicate check to satisfy our needs.

Is there any way to override or customize the generated WIQL? Basically what we want to do is something like the below where we can have control over the supplied values to the fields.

keyFields: |
  System.Title
  System.State<>'Done'

Scenario:

  1. Pipeline is running on schedule
  2. Work item is created for the issue with a somewhat static title.
  3. PO or Team might change work item state to approved etc. and edit some other fields during backlog refinement.
  4. Some time passes and the pipeline is run again
  5. This time we already have an refined item and don't want another.
    1. But since the item is not in state New any more a key field of just System.State won't do, and a new item would be created
    2. So we leave the State out of the key fields so it's being detected as a duplicate.
  6. Team resolves work item and it's state gets set to done.
  7. Some more time passes and the pipeline is run yet again.
  8. Now we want a new work item as we no longer have a work item that could be worked on since it's set to done and is hidden.
    1. But since we do not have state among the keyFields the old, completed item is found and treated as duplicate and the new requirement is lost.
ReneSchumacher commented 1 year ago

Hi @MichelJansson,

currently, that's not possible, but I do like the idea. I'll add it to our backlog and make sure we'll support something like this in the next release. Unfortunately, I don't have much time to work on the extensions at the moment, so I cannot tell you, how quickly I'll be able to add that.

MichelJansson commented 1 year ago

@ReneSchumacher, Thanks for the update.

I did figure out a workaround for my immediate specific issue by using the Closed Date as key field which is null until state is set to any of the closed states.

But I still think this would be a great thing to support, as that would be more intuitive and be more generic.

Is this extension pure closed source, or is there anywhere we could do a PR?

ReneSchumacher commented 1 year ago

Currently, is it still closed source as it's not super easy to make code open source at Microsoft, and I was not in the mood to go through all the necessary steps with our OSS and legal departments 😆 That is also on my agenda, but my role at Microsoft is Cloud Solution Architect - Engineering, so most of my time is spent with customers. That's why there haven't been many updates to the extensions recently, as we are pretty overutilized at the moment.

raydixon commented 1 year ago

@ReneSchumacher it sounds like you just wrote a pretty strong justification for making this open source. 🙂

ReneSchumacher commented 11 months ago

Hi all,

the complex update rules are now implemented in v2.x of the task. Closing this issue now. Please let me know if something is missing or not working as you expect it.