MicrosoftPremier / VstsExtensions

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

Create Work Item: Allow Bulk Creation of Work Items #156

Closed SebastianSchuetze closed 1 year ago

SebastianSchuetze commented 2 years ago

Hi,

I have been using your work item extension for some serious business for a while now. I am also referring to the same use case I explained here: #142

We scan repos for secrets and want to create report. In the way AzDO works you usually would create a work item for each repo. So you can properly chunk the and Link one PR to one issue.

So in our Org we have probably over a hundred repos that we need to scan and potentially create tens of work items. It would be cool if this task would also support a different mode like "Bulk Create" for work items and I would have an idea how:

[{
    "teamProject": "Azure DevOps Services",
    "workItemType": "Product Backlog Item",
    "title": "Tokens for account xyz will expire soon",
    "areaPath": "Azure DevOps Services\\AzDO Kanban",
    "fieldMappings": {
      "Priority": "1",
      "Description": "Some Text",
      "Tags": [
        "Blocker",
        "Critical",
        "Some Tag"
      ],
      "Acceptance Criteria": "Some Text",
      "Backlog Priority": 100000
    },
    "associate": "true",
    "associationType": "foundInBuild",
    "addAttachments": "true",
    "attachmentsFolder": "My Folder",
    "attachments": "My Attachement"
  },
  {
    "teamProject": "Another Project",
    "workItemType": "Task",
    "title": "Some Title",
    "areaPath": "Azure DevOps Services\\AzDO Kanban",
    "fieldMappings": {
      "Description": "Some Text",
      "Tags": [
        "Some Tag"
      ],
      "Backlog Priority": 200000
    }   
  }
]

so the idea is. that you use the same configuration options as key / value pair in JSON.

If the code would be open source I would make a PR :-)

SebastianSchuetze commented 2 years ago

You could probably somewhere attach to your JS function WorkItemCreationParameters to inject the JSON and map each array object there with a constructor or something.

SebastianSchuetze commented 1 year ago

Any update on this?

ReneSchumacher commented 1 year ago

Hi again,

we are in the process of implementing this and will hopefully be done sometime next week.

ReneSchumacher commented 1 year ago

Implementation is done and new version 2.3.0 of the task should be available in a couple minutes. Bulk mode supports the same features as single item mode, except for OIDC authentication. This is technically no possible (or would require some very ugly workarounds), so only PAT authentication can be used for bulk mode.