AzureDevOps.GetWorkItemDetails not returning fields data

202 views Asked by At

I'm trying to build a simple view of Work Items and Work Item Details in a Canvas PowerApp, and am running into issues with GetWorkItemDetails giving me the data I'm looking for.

Here's my code to display the Repro Steps field from the Bug work item type.

Text(AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id', Account, Project, "Bug").fields.'System.Repro Steps')

This is not returning anything, although I do get data back for these fields:

Text(AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id', Account, Project, "Bug").id)
Text(AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id', Account, Project, "Bug").url)

Any ideas on how to debug this? I know I'm doing something wrong with the "fields" property - I've tried fields.repro_steps, fields.'Repro Steps', etc. Nothing seems to work...

UPDATE: I think it has something to do with either how "GetWorkItemDetails" works, or potentially how the PowerApps Custom Connector is deciding which fields to bring back. I took a step back and tried a couple more variations...

// this works
Gallery1.Selected.Value.'Custom.Category'

// this doesn't work
AzureDevOps.GetWorkItemDetails(Gallery1.Selected.Value.'System.Id', Account, Project, "Bug").fields.'Custom.Category'

// alas, this doesn't work either
Gallery1.Selected.Value.'Microsoft.VSTS.TCM.ReproSteps'
1

There are 1 answers

3
Kevin Lu-MSFT On BEST ANSWER

The cause of the issue is that the field name used in the AzureDevOps.GetWorkItemDetails is not correct.

You can change to use the value Microsoft.VSTS.TCM.ReproSteps to represent the Repo Steps field.

Any ideas on how to debug this?

To get the correct name of the field, I suggest that you can use this Rest API: Field-List

GET https://dev.azure.com/{organization}/{project}/_apis/wit/fields?api-version=7.1-preview.3

For example:

enter image description here

Update:

When using the AzureDevOps.GetWorkItemDetail, you can use the following two format to access the work item field.

For example: replace Microsoft.VSTS.TCM.ReproSteps with Microsoft_VSTS_TCM_ReproSteps. fields.Microsoft_VSTS_TCM_ReproSteps

Text(AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id', Account, Project, "Bug").fields.Microsoft_VSTS_TCM_ReproSteps)

Or keep using the Microsoft.VSTS.TCM.ReproSteps, but we need to use the format: value.'Microsoft.VSTS.TCM.ReproSteps'

For example:

Text(AzureDevOps.GetWorkItemDetails(Gallery2.Selected.Value.'System.Id', Account, Project, "Bug").value.'Microsoft.VSTS.TCM.ReproSteps')