Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Not able to create a release workitem using CreateWorkItem@2 task

I am trying to create a release work item using azure pipeline task "CreateWorkItem@2" but the pipeline is failing due to TF401320: Rule Error for field Description error.

Task Code"

- task: CreateWorkItem@2
  inputs:
    teamProject: $(project)
    workItemType: 'Release'
    title: $(title)
    assignedTo: '$(Build.RequestedFor)'
    areaPath: $(areaPath)
    iterationPath: ${{ parameters.IterationPath }}
    fieldMappings: '[Description=This has been bulk created by CWI task, 
                     Transition Management Approved=No, Not required.]'
    authType: 'internal'

Wants create a release work item using

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

CreateWorkItem@2

>Solution :

TF401320: Rule Error for field Description error.

Based on your YAML definition, the cause of the issue is that the Description field value not input the correct value when creating work item.

To solve this issue, you need to change the fieldMappings field of the CreateWorkItem@2 with the following format:

fieldMappings: |
 field1=value1
 field2=value2

Task example:

- task: CreateWorkItem@2
  inputs:
    teamProject: $(project)
    workItemType: 'Release'
    title: $(title)
    assignedTo: '$(Build.RequestedFor)'
    areaPath: $(areaPath)
    iterationPath: ${{ parameters.IterationPath }}
    fieldMappings: |
     Description=This has been bulk created by CWI task
     Transition Management Approved=No, Not required.
    authType: 'internal'

In this case, the Description and Transition Management Approved field will be input the correct value when creating work items.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading