WorkItemUpdater
WorkItemUpdater copied to clipboard
##[error]TypeError: Cannot read property 'split' of undefined
Getting the above error when trying to update a custom field value. using the below configuration:
- task: WorkItemUpdater@2
inputs:
workitemsSource: 'Build'
workitemLimit: '999'
updateAssignedTo: 'Never'
updateFields: 'Microsoft.VSTS.Build.IntegrationBuild,Test Build'
Can you also post a logfile? Maybe run with debug enabled? I tested this functionality and it works, so it's probably a configuration/setup issue in your DevOps project.
Sorry for the delay. Things got crazy around the holidays.
Here is the raw log from the build. This is cloud DevOps, not on-prem:
2022-02-11T16:01:33.1865554Z ##[debug]Evaluating condition for step: 'WorkItemUpdater'
2022-02-11T16:01:33.1870679Z ##[debug]Evaluating: SucceededNode()
2022-02-11T16:01:33.1871489Z ##[debug]Evaluating SucceededNode:
2022-02-11T16:01:33.1872999Z ##[debug]=> True
2022-02-11T16:01:33.1873539Z ##[debug]Result: True
2022-02-11T16:01:33.1874161Z ##[section]Starting: WorkItemUpdater
2022-02-11T16:01:33.2050405Z ==============================================================================
2022-02-11T16:01:33.2050696Z Task : WorkItem Updater
2022-02-11T16:01:33.2051307Z Description : This task adds functionality to update WorkItems during a Build or Release.
2022-02-11T16:01:33.2051576Z Version : 2.5.830
2022-02-11T16:01:33.2051729Z Author : Blue Basher
2022-02-11T16:01:33.2051871Z Help :
2022-02-11T16:01:33.2052380Z ==============================================================================
2022-02-11T16:01:33.2310830Z ##[debug]Using node path: C:\agents\2.198.3\externals\node10\bin\node.exe
2022-02-11T16:01:33.4218911Z ##[debug]agent.TempDirectory=D:\a\_temp
2022-02-11T16:01:33.4245913Z ##[debug]loading inputs and endpoints
2022-02-11T16:01:33.4265851Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2022-02-11T16:01:33.4284082Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2022-02-11T16:01:33.4287836Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2022-02-11T16:01:33.4291230Z ##[debug]loading INPUT_ALLWORKITEMSSINCELASTRELEASE
2022-02-11T16:01:33.4294113Z ##[debug]loading INPUT_BYPASSRULES
2022-02-11T16:01:33.4296769Z ##[debug]loading INPUT_FAILTASKIFNOWORKITEMSAVAILABLE
2022-02-11T16:01:33.4297710Z ##[debug]loading INPUT_LINKBUILD
2022-02-11T16:01:33.4301745Z ##[debug]loading INPUT_UPDATEASSIGNEDTO
2022-02-11T16:01:33.4304702Z ##[debug]loading INPUT_UPDATEASSIGNEDTOWITH
2022-02-11T16:01:33.4307635Z ##[debug]loading INPUT_UPDATEFIELDS
2022-02-11T16:01:33.4310192Z ##[debug]loading INPUT_WORKITEMDONE
2022-02-11T16:01:33.4312664Z ##[debug]loading INPUT_WORKITEMLIMIT
2022-02-11T16:01:33.4314754Z ##[debug]loading INPUT_WORKITEMSSOURCE
2022-02-11T16:01:33.4320799Z ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
2022-02-11T16:01:33.4328752Z ##[debug]loaded 14
2022-02-11T16:01:33.4334427Z ##[debug]Agent.ProxyUrl=undefined
2022-02-11T16:01:33.4335311Z ##[debug]Agent.CAInfo=undefined
2022-02-11T16:01:33.4335989Z ##[debug]Agent.ClientCert=undefined
2022-02-11T16:01:33.4336591Z ##[debug]Agent.SkipCertValidation=undefined
2022-02-11T16:01:33.6738567Z ##[debug]System.TeamFoundationCollectionUri=https://preventicepoc.visualstudio.com/
2022-02-11T16:01:33.6801193Z ##[debug]SYSTEMVSSCONNECTION auth param AccessToken = ***
2022-02-11T16:01:33.6828604Z ##[debug]Build.BuildId=207
2022-02-11T16:01:33.6830101Z ##[debug]System.TeamProjectId=ef0619c3-d109-4b01-8a51-b000400cda80
2022-02-11T16:01:33.6831550Z ##[debug]Build.RequestedFor=Granicus422
2022-02-11T16:01:33.6833644Z ##[debug]workitemsSource=Build
2022-02-11T16:01:33.6834701Z ##[debug]workitemsSourceQuery=undefined
2022-02-11T16:01:33.6837377Z ##[debug]allWorkItemsSinceLastRelease=false
2022-02-11T16:01:33.6838481Z ##[debug]workItemType=undefined
2022-02-11T16:01:33.6839449Z ##[debug]workitemLimit=999
2022-02-11T16:01:33.6840439Z ##[debug]workItemState=undefined
2022-02-11T16:01:33.6841467Z ##[debug]workItemCurrentState=undefined
2022-02-11T16:01:33.6842658Z ##[debug]workItemKanbanLane=undefined
2022-02-11T16:01:33.6843649Z ##[debug]workItemKanbanState=undefined
2022-02-11T16:01:33.6844616Z ##[debug]workItemDone=false
2022-02-11T16:01:33.6845546Z ##[debug]linkBuild=false
2022-02-11T16:01:33.6846506Z ##[debug]updateAssignedTo=Never
2022-02-11T16:01:33.6848960Z ##[debug]updateAssignedToWith=Requester
2022-02-11T16:01:33.6849988Z ##[debug]assignedTo=undefined
2022-02-11T16:01:33.6850942Z ##[debug]comment=undefined
2022-02-11T16:01:33.6852100Z ##[debug]updateFields=Microsoft.VSTS.Build.IntegrationBuild,Test build
2022-02-11T16:01:33.6853376Z ##[debug]bypassRules=false
2022-02-11T16:01:33.6854548Z ##[debug]failTaskIfNoWorkItemsAvailable=false
2022-02-11T16:01:33.6858051Z ##[debug]addTags=undefined
2022-02-11T16:01:33.6859101Z ##[debug]removeTags=undefined
2022-02-11T16:01:33.6860514Z ##[debug]Release.ReleaseId=undefined
2022-02-11T16:01:33.6861515Z ##[debug]Release.DefinitionId=undefined
2022-02-11T16:01:33.6862705Z ##[debug]Release.DefinitionEnvironmentId=undefined
2022-02-11T16:01:33.6863751Z ##[debug]BuildId 207
2022-02-11T16:01:33.6864811Z ##[debug]ProjectId ef0619c3-d109-4b01-8a51-b000400cda80
2022-02-11T16:01:33.6865861Z ##[debug]ReleaseId undefined
2022-02-11T16:01:33.6866777Z ##[debug]DefinitionId undefined
2022-02-11T16:01:33.6867992Z ##[debug]DefinitionEnvironmentId undefined
2022-02-11T16:01:33.6869065Z ##[debug]requestedFor Granicus422
2022-02-11T16:01:33.6870034Z ##[debug]workitemsSource Build
2022-02-11T16:01:33.6871042Z ##[debug]workitemLimit 999
2022-02-11T16:01:33.6871992Z ##[debug]workitemsSourceQuery undefined
2022-02-11T16:01:33.6873171Z ##[debug]allWorkItemsSinceLastRelease false
2022-02-11T16:01:33.6874148Z ##[debug]workItemType undefined
2022-02-11T16:01:33.6875099Z ##[debug]WorkItemState undefined
2022-02-11T16:01:33.6876000Z ##[debug]workItemCurrentState undefined
2022-02-11T16:01:33.6876956Z ##[debug]updateWorkItemKanbanLane undefined
2022-02-11T16:01:33.6877968Z ##[debug]WorkItemKanbanState undefined
2022-02-11T16:01:33.6878920Z ##[debug]WorkItemDone false
2022-02-11T16:01:33.6879854Z ##[debug]updateAssignedTo Never
2022-02-11T16:01:33.6881799Z ##[debug]updateAssignedToWith Requester
2022-02-11T16:01:33.6883232Z ##[debug]assignedTo undefined
2022-02-11T16:01:33.6885113Z ##[debug]addTags undefined
2022-02-11T16:01:33.6886265Z ##[debug]updateFields Microsoft.VSTS.Build.IntegrationBuild,Test build
2022-02-11T16:01:33.6887313Z ##[debug]comment undefined
2022-02-11T16:01:33.6888247Z ##[debug]removeTags undefined
2022-02-11T16:01:33.6889191Z ##[debug]bypassRules false
2022-02-11T16:01:33.6891493Z ##[debug]failTaskIfNoWorkItemsAvailable false
2022-02-11T16:01:33.6892699Z ##[debug]Get WorkItemTrackingApi
2022-02-11T16:01:34.1447788Z ##[debug]Get workItemsRefs
2022-02-11T16:01:34.1469679Z Using Build as WorkItem Source
2022-02-11T16:01:34.3745876Z ##[debug]Loop workItemsRefs
2022-02-11T16:01:34.3749528Z ##[debug]Found WorkItemRef: 24
2022-02-11T16:01:34.5990372Z Found WorkItem: 24
2022-02-11T16:01:34.5991718Z ##[debug]Setting assignedTo to requester for build "Granicus422".
2022-02-11T16:01:34.5997822Z ##[debug]Updating WorkItem: 24
2022-02-11T16:01:34.6018317Z ##[debug]Caught an error in main: TypeError: Cannot read property 'split' of undefined
2022-02-11T16:01:34.6019446Z ##[debug]task result: Failed
2022-02-11T16:01:34.6020818Z ##[error]TypeError: Cannot read property 'split' of undefined
2022-02-11T16:01:34.6022056Z ##[debug]Processed: ##vso[task.issue type=error;]TypeError: Cannot read property 'split' of undefined
2022-02-11T16:01:34.6060427Z ##[debug]Processed: ##vso[task.complete result=Failed;]TypeError: Cannot read property 'split' of undefined
2022-02-11T16:01:34.6183263Z ##[section]Finishing: WorkItemUpdater
I also was having this error. The workItemType field seems to be mandatory. Maybe a little validation / informative error message would make this a little easier to work through.
I also was having this error. The workItemType field seems to be mandatory. Maybe a little validation / informative error message would make this a little easier to work through.
The workItemType is mandatory, if you use the classic YAML editor you w7ill see that this rule is enforced.