You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/connections/azure-devops.md
+29-8Lines changed: 29 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,15 +22,17 @@ Power Apps connector for [Azure DevOps](/connectors/visualstudioteamservices/) a
22
22
> [!TIP]
23
23
> For a complete list of all actions, see [Azure DevOps connector actions](/connectors/visualstudioteamservices/#actions).
24
24
25
-
In this article, you'll create a canvas app that connects to Azure DevOps to retrieve the list of queries, and work with work items within the project.
25
+
The objective of this article is to guide you in building a canvas app that can connect with Azure DevOps to gather a list of queries and interact with the work items in the project.
26
26
27
27
## Prerequisites
28
28
29
-
- You need a Power Apps license. If you don't have a license, use a [30-day trial](../../signup-for-powerapps.md), or sign up for a [developer plan](../../developer-plan.md) for non-production use.
29
+
The following requirements are necessary:
30
+
31
+
- A Power Apps license. If you don't have a license, use a [30-day trial](../../signup-for-powerapps.md), or sign up for a [developer plan](../../developer-plan.md) for non-production use.
30
32
- If you're new to Power Apps, familiarize yourself with Power Apps basics by [generating an app](../get-started-test-drive.md) and then customizing that app's [controls](../add-configure-controls.md), [gallery](../add-gallery.md), [forms](../working-with-forms.md), and [cards](../working-with-cards.md).
31
-
-You need a[blank canvas app](../create-blank-app.md) to use to connect to Azure DevOps.
32
-
-You need an [Azure DevOps](/azure/devops/user-guide/what-is-azure-devops) instance that has an organization, a project, and a shared query that has few sample work items to edit using the app that you'll create in this article.
33
-
- The Azure DevOps instance that must be enabled for **Third-party application access via OAuth**. To configure this setting, see [Manage access policies for Azure DevOps](/azure/devops/organizations/accounts/change-application-access-policies#manage-a-policy).
33
+
-A[blank canvas app](../create-blank-app.md) to use to connect to Azure DevOps.
34
+
-To create the app featured in this article, you'll require an [Azure DevOps](/azure/devops/user-guide/what-is-azure-devops) instance that includes an organization, a project, and a shared query with a few sample work items available for editing.
35
+
- The Azure DevOps instance must be enabled for **Third-party application access via OAuth**. For more information, see [Manage access policies for Azure DevOps](/azure/devops/organizations/accounts/change-application-access-policies#manage-a-policy).
34
36
35
37
## Step 1 - Add Azure DevOps data source
36
38
@@ -163,18 +165,37 @@ So far we have been using the Edit form which simplifies the data access story b
Note that "WorkItemType" is a text property passed in (e.g., "Feature") that allows you to pivot from items like Features and Work Items. The set of fields for these items vary from each other - which is why the return type from this call is dynamic.
168
+
When you pass the text property "WorkItemType", for instance, "Feature", it allows you to switch from items such as Features and Work Items. Since the set of fields for these items differ from one another, the return type from this call is dynamic.
169
+
170
+
You can access specific values using the common method Text(ThisItem.Value.'System.Id'). Alternatively, you may access them through the more general dynamic response using Text(ThisItem.fields.System_Id). These dynamic value names are not typically documented. To find the correct names for these fields, including non-standard fields, open the monitor tool and examine the data response for the GetWorkItemDetails call. Refer to the image below for further guidance.
167
171
168
-
To access specific values you can still access the common values the same way (e.g.,`Text(ThisItem.Value.'System.Id')` ). However, you may also access them in the more general dynamic response this way: `Text(ThisItem.fields.System_Id)`. These dynamic values names aren't generally documented. The easiest way to see the correct names for these fields - including the non-standard fields is to open the monitor tool and look at the data response. In this case, to the `GetWorkItemDetails` call. (See image below.)
172
+
If you're not utilizing an Edit form, but instead using a container, then you can retrieve these values by using a formula such as the one below, which retrieves information from a custom team field.
169
173
170
-
If you aren't using an Edit form, but rather simply a container, then you can access these values with a formula like the following: (Which accesses a custom team field.)
> 
181
+
>
182
+
>
183
+
## Updating values in Azure DevOps
184
+
185
+
To update a value in Azure Dev ops use the UpdateWorkItem in the OnSelect of a button.
186
+
187
+
```powerapps-dot
188
+
AzureDevOps.UpdateWorkItem(
189
+
Gallery2.Selected.Value.'System.Id',
190
+
Organization,
191
+
{ description: "This is a new description",
192
+
dynamicFields: ParseJSON(JSON({'Custom Field 1': "This is new custom text" }))
193
+
}
194
+
);
195
+
```
196
+
The formula adds new sample text but you can also use a PowerFx expression.
197
+
198
+
Ensure that the formula uses lower case for the *non-custom* or built-in field names. For example, when referring to "Description" field, use `description: "This is a new description"` instead of `Description:"This is a new description"`. Incorrect casing might result in the error "400 Required parameter missing for requested operation: 'UpdateWorkItem'". For custom / dynamic values, you can use the normal casing of display field. For instance the field name for the custom field is just the display name 'Custom Field 1'. This naming convention of the return values is specific to Azure DevOps and may differ from other services.
0 commit comments