# Creating Work Items using Azure DevOps pipeline

There can be situations where you want to create issues in Azure DevOps whenever a task/job/step is failed. For creating a work item, we need to install the plugin from Azure Marketplace.

Click on Marketplace and click on Browse Marketplace.

marketplace -&gt; Browse the marketplace

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685872979974/a5714c4a-6a71-44d7-b3ef-0f326838ef8b.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685872802063/57857b90-0490-440d-8999-2ec670695f53.png align="center")

Once the plugin is installed, we can use Create Work Item item.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685873156525/c7ad9e8b-1a54-400c-af10-d9e6e6baee59.png align="center")

To create work Item, in case the previous task is failed, we can use the below configuration.

Note: To avoid duplicate ticket creation, we can use preventDuplicates: true along with keyFields.

```yaml
  - task: Docker@2
    inputs:
      containerRegistry: '${Dockerregistry_service_Connection}'
      repository: '${Docker_repository}'
      command: 'buildAndPush'
      Dockerfile: '**/Dockerfile'
      continueOnError: true



  - task: CreateWorkItem@1
    displayName: 'Create work item'
    inputs:
      workItemType: Task 
      title: docker task failed
      preventDuplicates: true
      keyFields: 'System.Title'      
    condition: failed()
    continueOnError: true
```
