I'm trying to get the payload content coming from the webhook that trigger the pipeline when a work item is updated.
I have a powershell Task to try to get the content, for example, when a work item is updated, i want to get the System.AreaPath that is in the WorkItem and available in the payload.
trigger:
none
pool:
name: SYNCCHR
resources:
webhooks:
- webhook: GETPAYLOAD
connection: GETPAYLOAD_CON
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "${{ parameters.GETPAYLOAD.resource.workItemId }}"
Write-Host "${{ parameters.GETPAYLOAD.resource.revision.rev }}"
Write-Host '${{ parameters.GETPAYLOAD.resource.revision.fields.System.AreaPath }}'
i don't find a way to get the System.Area value. parameters.GETPAYLOAD is a yaml expression related withe the parameters variable, it is gobal variable built-in in the yaml pipeline in Devops.
The fact the property System.AreaPath contains a dot in the name does not help with yaml syntax !
The payload is containing this kind of json :
I tried many time different syntax, triggering the pipeline via the update of work item but i can not obtain the content of properties under revision or fields nodes.
The goal is to be able to obtain in powershell task any property in the payload.
i found finally the way to obtain the data concerning System.AreaPath:
the syntax is