Azure DevOps Integration (via Microsoft Power Automate)


About This Integration

IntegrationIntroduction

You can integrate third-party systems with Product name - ev itsm.png in many ways. The method you select will depend on business requirements, architectural and security constraints as well as the characteristics specific to each third-party application or service.

This document describes an integration process that has already been implemented in a customer context. 

To find out more about this integration (e.g. scripts to be used), please contact the Logo - EasyVista.png Consulting & Professional Services team, the Logo - EasyVista.png Support team, or your service provider and integrator.
 

Overview of the integration

Azure DevOps is a Microsoft solution. It is a management tool for DevOps projects that ensures monitoring for tasks, deadlines, problems and calendars relating to applications.

This integration enables you to create a Bug work item in Azure DevOps from a ticket created in Service Manager using Microsoft Power Automate. You can then add a notification in the comments of the Service Manager ticket to indicate a change in the status, scheduled end date and/or group/user assigned.
  

Preview of the tools used in this integration

  • Microsoft Power Automate (formerly known as Microsoft Flow) enables you to automate recurrent tasks by building workflows using Web applications. These applications use MS Power Automate connectors (based on Microsoft Azure Logic Apps) or the MS Graph gateway for interfacing with any endpoint via HTTP/HTTPS.
     
Integration Data Feed (direction) Authentication Type Integration Connector Options

Logo - EV Service Manager.png

Down arrow.png

Logo Icon - Microsoft Flow.png

Down arrow.png

Logo Icon - Azure DevOps.png

Down arrow.png

Logo Icon - Microsoft Flow.png

Down arrow.png

Logo - EV Service Manager.png

  • Depending on the third-party service used (authentication managed by Logic Apps)
  • Basic Authentication for the Service Manager REST API
  • Service Manager:

    EV Integration connector icon - Workflow.png    Workflows

    EV Integration connector icon - Business rule.png    Business rules

  • MS Power Automate:

    EV Integration connector icon - Receive.png    Connector: When a HTTP request is received

    (Service Manager trigger => Logic Apps)

Available versions
SaaS-based On-premises
Service Manager Check icon.png Check icon.png
Third-Party Product Check icon.png N/A

Azure DevOps - definitions

  • Work items are used to monitor functionalities and specifications, code errors, bugs, etc.
  • Each work item is based on a work item type and has a unique ID.
  • The work item types available are based on the processes used when creating projects, e.g. agile, scrum, etc. The Bug work item type enables you to monitor bugs and can be configured differently by each team.
  • Work items can be assigned to other work items according to a hierarchy based on parent-child relationships.

Microsoft Power Automate flows

The integration between Service Manager and Azure DevOps during ticket creation in Service Manager can lead to three separate flows in Microsoft Power Automate.

Flow 1: Create a work item in Azure DevOps and store the reference in the Service Manager ticket Flow 2: Create a work item in Azure DevOps associated with a specific parent item Flow 3: Notify work item changes in the Service Manager ticket
Data feed diagram 1 - EN.png Data feed diagram 2 - EN.png Data feed diagram 3 - EN.png

Prerequisites

Best Practice

  • The procedure describes all of the steps for creating Microsoft Power Automate flows. To facilitate integration, the ZIP folders shipped with this integration contain pre-configured flows. Once you have downloaded them, you should specify the parameters specific to your environment, i.e. Azure account credentials, EasyVista server address, login information of your Service Manager platform, etc.

Integration process

1. Create a Bug work item type in Azure DevOps for the process template used by your DevOps project. Open url.png See the detailed procedure.

2. Import the flow you want to set up for monitoring Service Manager tickets in your Azure DevOps project. Open url.png See the procedure for importing flows.

        Download icon.png  Flow Create a work item

        Download icon.png  Flow Create a work item associated with a specific parent item

        Download icon.png  Flow Notify work item changes in the Service Manager ticket

3. Configure the MS Power Automate flow you imported. Open url.png See the detailed procedures:

Step-by-Step Integration Process

Create the Bug work item type

Caution: Make sure you create the work item type in the process template or in the process used by your DevOps project.

Step 1: Log in to Azure DevOps

1. Log in to Azure DevOps using your Azure account.

2. Click the name of your organization.

3. Click Organization settings.

         Azure DevOps - Open.png
 

Step 2: Create the Bug work item type

1. Select Boards > Process in the menu pane.
The list of DevOps processes will appear.
         Azure DevOps - Open processes.png

2. Select the DevOps project in which you want to monitor tickets created in Service Manager.
The list of work item types defined for the project processes will appear.
         Azure DevOps - Work item types.png

3. Click + New work item type.

4. Specify the information on the new work item type and name it Bug.
         Azure DevOps - Work item types - Creation.png

5. Click Create.
The properties of the new work item type will appear.
 

Step 3: Create two EZV custom fields to store the Service Manager ticket references

Caution: Make sure you select the Bug work item type.

1. Click New field.

         Azure DevOps - Work item types - Creation EZV fields.png

3. Specify the information on storing the ticket ID in the new field and name it EZV_ID.
         Azure DevOps - Work item types - Creation EZV fields - Add field.png

4. Click Add field.
The new field will be associated with the Bug work item type in the Custom section.
         Azure DevOps - Work item types - Creation EZV fields - Detail.png

5. Repeat the procedure to create the second field for storing the ticket URI and name it EZV_URI.

Import a workflow to Microsoft Power Automate

Step 1: Import a Azure DevOps Connection flow to Microsoft Power Automate

1. Download the relevant file below to your workstation.

       Download icon.png  Flow Create a work item

        Download icon.png  Flow Create a work item associated with a specific parent item

        Download icon.png  Flow Notify work item changes in the Service Manager ticket

2. Import the file to Microsoft Power Automate.

  • Click My flows in the left pane.
    A list of your MS Power Automate flows will appear.
             Microsoft Flow - Flow list.png
  • Click Import in the menu bar and select the file you downloaded.
    Once imported, the package contents will appear.
     

Step 2: Create the connection to Azure DevOps

1. Click the Select during import link in the Import Setup column.
         Microsoft Flow - Package information.png

The window for configuring the import will appear.
         Microsoft Flow - Package - Create connection 1.png

2. Create the connection to Azure DevOps.

  • Click + Create.
    • An MS Power Automate instance will appear in a new Web browser tab.
    • The list of existing connections will appear.
  • Click + New connection.

         Microsoft Flow - Package - Create connection 2.png

  • Search for the Azure DevOps connector using the search field. Select it from the list of results.

         Microsoft Flow - Package - Select connection.png

A window displaying the list of permissions to be granted to Microsoft Power Platform will appear.

  • Click Create to create the new connection.
  • Click Accept to accept the conditions and authorize Microsoft Power Platform access.
    • You will return to the tab displaying the list of MS Power Automate flows.
    • The new Azure DevOps connection will appear in the list of resources.
      Microsoft Flow - Package - New connection added.png

3. Close your Web browser tab.

  • You will return to the tab displaying the details of the imported package.
  • The new Azure DevOps connection will appear in the window for configuring the flow to be imported.
             Microsoft Flow - Package - Save connection.png

4 Select the connection and click Save.

5 Click Import.

         Microsoft Flow - Package - Import flow.png

6 Finish importing the flow.

  • Click Save as new flow in the message displayed at the top of the page.

             Microsoft Flow - Package - Import flow - Save as new flow.png
    • An MS Power Automate instance will appear in a new Web browser tab.
    • The workflow of the imported package will appear.
               Microsoft Flow - Package - Import flow - Save as new flow - Connection configuration 1.png
  • Click the Connections step indicating that the connection created for Azure DevOps is invalid.
  • Select the connection you created for Azure DevOps.
             Microsoft Flow - Package - Import flow - Save as new flow - Connection configuration 2.png
  • Specify the relevant information for the step.
    • Organization Name: Select the name of your organization.
    • Project Name: Select the name of your DevOps project.
               Microsoft Flow - Package - Import flow - Save as new flow - Connection configuration 3.png
  • Click Save.
    The error message will disappear.
             Microsoft Flow - Package - Import flow - Save as new flow - Connection configuration 4.png
    The Azure DevOps connection is configured and the flow will be imported.
             Microsoft Flow - Package - Import flow - Success.png
     

Step 3: Configure the imported flow

1. Move your cursor over the name of the flow and click Edit icon.png.
         Microsoft Flow - Edit flow.png

The workflow will appear.
         Microsoft Flow - Detail flow.png

2. See the procedure for configuring the imported flow.

Create MS Power Automate flow 1

Description of the Create a work item in Azure DevOps workflow

         Azure flow description - Creation Azure DevOps work item.png


Step 1: Create the step that will trigger the flow.

==> The flow is triggered when a ticket is created in Service Manager.

1. Create a When a HTTP request is received step for triggering the workflow.

         Action Azure - Creation Azure DevOps work item - When a http request is received.png

2. Specify the information on the trigger.

  • Body: Copy and paste the JSON schema below.

    Display the JSON schema

    {
       "$id": "http://example.com/example.json",
       "type": "object",
       "definitions": {},
       "$schema": "http://json-schema.org/draft-07/schema",
       "properties": {
           "Description": {
               "$id": "/properties/Description",
               "type": "string",
               "title": "Description",
               "default": "",
               "examples": [
                   "{Description}"
                ]
            },
           "id": {
               "$id": "/properties/id",
               "type": "string",
               "title": "Id",
               "default": "",
               "examples": [
                   "{id}"
                ]
            },
           "Host": {
               "$id": "/properties/Host",
               "type": "string",
               "title": "Host",
               "default": "",
               "examples": [
                   "{Host}"
                ]
            },
           "Account": {
               "$id": "/properties/Account",
               "type": "string",
               "title": "Account",
               "default": "",
               "examples": [
                   "{Account}"
                ]
            },
           "URL": {
               "$id": "/properties/URL",
               "type": "string",
               "title": "URL",
               "default": "",
               "examples": [
                   "{URL}"
                ]
            },
           "Title": {
               "$id": "/properties/Title",
               "type": "string",
               "title": "Title",
               "default": "",
               "examples": [
                   "{Title}"
                ]
            }
        }
    }
  • Method: Select the POST  value.

3. Save the trigger.

The following information will be retrieved from Service Manager: Ticket description, ticket ID, Host, Account, URL, title of the ticket.


Step 2: Create a work item containing the Service Manager ticket reference

1. Search for the Azure DevOps connector and select the Create a work item action.

Best Practice icon.png  Use the search field to find the connector and action you want quickly.

         Action Azure - Select Azure DevOps connector - Create work item.png

2. Specify the information on the action.

  • Organization Name: Name of your organization.
  • Project Name: Name of your DevOps project.
  • Work Item Type: Select Bug.
  • Title: Title of the Service Manager ticket. Select the dynamic value called Title from the When a HTTP request is received step.
  • Description: Description of the Service Manager ticket. Select the dynamic value called Description from the When a HTTP request is received step.
             Action Azure - Creation Azure DevOps work item - Information.png
     

Step 3: Store the work item ID in the Service Manager ticket

1. Create a HTTP step and rename it Update Ticket using Browse black points icon.png in the title bar.

         Action Azure - Azure DevOps update ticket - Information.png

2. Specify the information on the action.

  • Method: Enter the PUT value.
  • URI: Enter the URL below.

    concat(triggerBody()?['URL'],'requests/',triggerBody()?['id'])

  • Body: Copy and paste the JSON schema below.
    {
     "Comment": "ID Azure : @{outputs('Create_a_Work_Item')?['body/id']}"
  • Advanced options:
    • Authentication: Select the Basic value.
    • Username: Service Manager platform account.
    • Password: Password of the Service Manager platform account.

3. Save the flow.

  • The work item will be created with the Service Manager ticket reference.
  • The work item ID will be saved in the Service Manager ticket comments.

Create MS Power Automate flow 2

Description of the Create a work item in Azure DevOps flow associated with a specific parent item workflow

         Azure flow description - Creation Azure DevOps work item with parent.png

Step 1: Create the step that will trigger the flow.

==> The flow is triggered when a ticket is created in Service Manager.

The procedure is identical to the one for MS Power Automate flow 1, Create a work item in Azure DevOps.

    Open url.png See the procedure for creating the step that will trigger flow 1.

Step 2: Create a work item containing the Service Manager ticket reference

The procedure is identical to the one for MS Power Automate flow 1, Create a work item in Azure DevOps.

    Open url.png See the procedure for creating a work item for flow 1.

Step 3: Store the ID of the specific parent item in the work item

1. Search for the Azure DevOps connector and select the Update a work item action.

         Action Azure - Select Azure DevOps connector - Update work item.png

2. Specify the information on the action.

  • Organization Name: Name of your organization.
  • Work Item ID: Work item ID associated with the Service Manager ticket. Select the dynamic value called ID from the Create a Work Item step.
  • Link URL: Enter the URL of the specific parent work item in the following format.

    https://dev.azure.com/{Organization_Name}/{Project_Name}/_apis/wit/workItems/{WorkItem_ID}

  • Link Type: Select the Hierarchy-reverse value.

         Action Azure - Update Azure DevOps work item parent - Information.png

3. Save the flow.

  • The work item will be created with the Service Manager ticket reference.
  • The ID of the specific parent item will be saved in the work item.

Create MS Power Automate flow 3

Description of the Notify work item changes in the Service Manager ticket workflow

         Azure flow description - Update Service Manager ticket.png

Step 1: Create the step that will trigger the flow.

==> The flow is triggered when the work item is updated.

1. Search for the Azure DevOps connector and select the When a Work Item is Updated trigger.

2. Specify the information on the action.

  • Organization Name: Name of your organization.
  • Project Name: Name of your DevOps project.
  • Type: Select the Bug work item type.

         Action Azure - Update Service Manager ticket - When a work item is update - Information.png
 

Step 2: Retrieve the ID of the group/user assigned to the Service Manager ticket (Group_ID field)

1. Search for the group stored in the Service Manager ticket.

  • Create a HTTP step and rename it Get Info Group ID HTTP using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Get Info Group ID HTTP - Information.png

  • Specify the information on the action.
    • Method: Enter the GET value.
    • URI: Enter the URL below.

      concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'actions?search=request.rfc_number:',triggerOutputs()?['body/fields/Custom_EZV_ID'],',end_date_ut:"is_null"&fields=group_id&sort=action_id+desc&max_rows=1')

    • Advanced options:
      • Authentication: Select the Basic value.
      • Username: Service Manager platform account.
      • Password: Password of the Service Manager platform account.

2. Break down the response from the Get Info Group ID HTTP step and retrieve the value of the Group_ID field.

  • Create a JSON Analysis step and rename it Analyse JSON Get Info Group ID using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Analyse JSON Get Info Group ID - Information.png

  • Specify the information on the action.
    • Content: Select the dynamic variable called Body from the Get Info Group ID HTTP step.
    • Schema: Copy and paste the JSON schema below.

      Display the JSON schema

      {
         "type": "object",
         "properties": {
             "HREF": {
                 "type": "string"
              },
             "record_count": {
                 "type": "string"
              },
             "total_record_count": {
                 "type": "string"
              },
             "records": {
                 "type": "array",
                 "items": {
                     "type": "object",
                     "properties": {
                         "HREF": {
                             "type": "string"
                          },
                         "ACTION_ID": {
                             "type": "string"
                          },
                         "GROUP_ID": {
                             "type": "string"
                          }
                      },
                     "required": [
                         "HREF",
                         "ACTION_ID",
                         "GROUP_ID"
                      ]
                  }
              }
          }
      }

Step 3: Retrieve the status, scheduled end date and group/user assigned in the Service Manager ticket (available_field_6 field)

1. Search for the Service Manager ticket.

  • Create a HTTP step and rename it Get Info Ticket HTTP using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Get Info Ticket HTTP - Information.png

  • Specify the information on the action.
    • Method: Enter the GET value.
    • URI: Enter the URL below.

      concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'requests/',triggerOutputs()?['body/fields/Custom_EZV_ID'])

    • Advanced options:
      • Authentication: Select the Basic value.
      • Username: Service Manager platform account.
      • Password: Password of the Service Manager platform account.

2. Break down the response from the Get Info Ticket HTTP step and retrieve the information on the $ProductName_ev_itsm{{/velocity}} ticket.

  • Create a JSON Analysis step and rename it Analyse Get Info Ticket JSON using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Analyse JSON Get Info Ticket - Information.png

  • Specify the information on the action.
    • Content: Select the dynamic variable called Body from the Get Info Ticket HTTP step.
    • Schema:
      • Copy the result of the Get Info Ticket HTTP step.
      • Click Generate from sample.
      • Paste the result.

3. Break down the value of the AVAILABLE_FIELD_6 field that contains the status, scheduled end date and group/user assigned.

  • Create an Initialize variable step and rename it Initialize variable Available Field 6 using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Initialize variable Available Field 6 - Information.png

  • Specify the information on the action.
    • Name: Enter the Field6 value.
    • Type: Select the Array value.
    • Value: Enter the instruction below.

      split(body('Analyser_Get_Info_Ticket_JSON'')?['AVAILABLE_FIELD_6'],',')

      • The Field6[0] variable contains the ticket status.
      • The Field6[1] variable contains the scheduled end date of the ticket.
      • The Field6[2] variable contains the group/user to which the ticket is assigned.
         

Step 4: Notify any changes made to the work item in the Comment field of the Service Manager ticket

Note:

  • Perform the actions below for the three types of work item changes, i.e. changes in the status, scheduled end date and group/user assigned.
  • Modify the sections in yellow based on the indications in the tables below.
     

1. Define conditions for testing each type of work item change.

         Action Azure - Update Service Manager ticket - Flow Change conditions work item.png

  • Create a Condition action for each type of change and rename it with the name indicated in the table below using Browse black points icon.png in the title bar.
Notified change Name of the step
Status Condition Status
Scheduled end date Condition Date
Assignment Condition Assigned To

         Action Azure - Post internal note Service Manager - Condition change Status - Information.png

  • Specify the condition using the information in the table below based on the type of change.
Notified change Condition
Status
  • Select Value: Enter the instruction below.
    variables('Field6')[0]
  • Comparator: Select is not equal to.
  • Value: Select State.
Scheduled end date
  • Select Value: Enter the instruction below.
    variables('Field6')[1]
  • Comparator: Select is not equal to.
  • Value: Select Date.
Assignment
  • Select Value: Enter the instruction below.
    variables('Field6')[2]
  • Comparator: Select is not equal to.
  • Value: Select Assigned To.

2. Store the changes in the Comment field of the Service Manager ticket.

  • Create a HTTP step for each type of change and rename it with the name indicated in the table below using Browse black points icon.png in the title bar.
Notified change Name of the step
Status POST Internal Note State HTTP
Scheduled end date POST Internal Note Date HTTP
Assignment POST Internal Note Assigned HTTP

         Action Azure - Update Service Manager ticket - POST Internal Note HTTP - Information.png

  • Specify the information of the action for each type of change by entering the body displayed in the table below.
    • Method: Enter the POST value.
    • URI: Enter the URL below.

      concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'requests/',triggerOutputs()?['body/fields/Custom_EZV_ID'],'/tasks') 

       
    • Body: Copy and paste the JSON schema indicated in the table below based on the type of change.
      Note: action_type_id = 95: ID of the Internal Note value
      Notified change Body: Copy and paste the JSON schema below.
      Status
      {
       "action_type_id": "95",
       "group_id": "@{items('Appliquer_à_chacun')?['GROUP_ID']}",
       "comment": "ADO : Change of State '@{triggerOutputs()?['body/fields/System_State']}'  "
      }
      Scheduled end date
      {
       "action_type_id": "95",
       "group_id": "@{items('Appliquer_à_chacun_2')?['GROUP_ID']}",
       "comment": "ADO : Change of Target Date '@{formatDateTime(triggerOutputs()?['body/fields/Microsoft_VSTS_Scheduling_TargetDate'], 'yyyy-MM-dd hh:mm:ss')}'"
      }
      Assignment
      {
       "action_type_id": "95",
       "group_id": "@{items('Appliquer_à_chacun_3')?['GROUP_ID']}",
       "comment": "ADO : Assigned To '@{triggerOutputs()?['body/fields/System_AssignedTo']}' "
      }
    • Advanced options:
      • Authentication: Select the Basic value.
      • Username: Service Manager platform account.
      • Password: Password of the Service Manager platform account.
         

Step 4: Notify any changes made to the work item in the available_field_6 field of the Service Manager ticket.

1. Define conditions for testing changes made to the work item.

  • Create a Condition action and rename it Condition Update Ticket, using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Condition Update Ticket - Information.png

  • Specify all of the conditions below by clicking Add to add a new row.
Notified change Condition
Status
  • Select Value: Enter the instruction below.
    variables('Field6')[0]
  • Comparator: Select is not equal to.
  • Value: Select State.
Scheduled end date
  • Select Value: Enter the instruction below.
    variables('Field6')[1]
  • Comparator: Select is not equal to.
  • Value: Select Target_Date.
Assignment
  • Select Value: Enter the instruction below.
    variables('Field6')[2]
  • Comparator: Select is not equal to.
  • Value: Select assigned_To.

2. Store the changes in the available_field_6 field of the Service Manager ticket.

  • Create a HTTP step and rename it PUT Update Ticket HTTP using Browse black points icon.png in the title bar.

         Action Azure - Update Service Manager ticket - Put Update Ticket HTTP - Information.png

  • Specify the information on the action.
  • Method: Enter the PUT value.
  • URI: Enter the URL below.

    concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'requests/',triggerOutputs()?['body/fields/Custom_EZV_ID']) 

  • Body: Copy and paste the JSON schema below.
    {
     "AVAILABLE_FIELD_6": "@{triggerOutputs()?['body/fields/System_State']},@{triggerOutputs()?['body/fields/Microsoft_VSTS_Scheduling_TargetDate']},@{triggerOutputs()?['body/fields/System_AssignedTo']}"
  • Advanced options:
    • Authentication: Select the Basic value.
    • Username: Service Manager platform account.
    • Password: Password of the Service Manager platform account.

3. Save the flow.

The changes made to the work item will be saved in the Service Manager ticket (available_field_6 and Comment fields).

Links to other integrations

List of files to download

Note: To find out more, see the Step-by-Step Integration Process.

        Download icon.png  Flow Create a work item

        Download icon.png  Flow Create a work item associated with a specific parent item

        Download icon.png  Flow Notify work item changes in the Service Manager ticket

Tags:
Last modified by Unknown User on 2021/10/27 17:14
Created by Administrator XWiki on 2021/10/27 17:10

Shortcuts

Recent changes
•  EV Service Manager
•  Service Apps
•  EV Self Help
•  Service Bots

Powered by XWiki ©, EasyVista 2021