Azure DevOps Integration (via Microsoft Power Automate)

Last modified on 2023/07/03 19:02

IntegrationIntroduction

You can integrate third-party systems with Service Manager 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 do not hesitate to contact your EasyVista contact, 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 when a ticket is created in Service Manager, via Microsoft Power Automate.

  • The number of the work item is saved in the Service Manager ticket.
  • A notification can be added to the comments and available_field_6 field of the Service Manager ticket to indicate changes to the status, scheduled end date and/or group/user assigned in the Azure DevOps work item.
  • The work item can be associated with a parent item in Azure DevOps.
      

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

Definitions_AzureDevOps
  • 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.
  • 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. They can be configured differently by each team.
    • The Bug work item type is used for tracking bugs.
    • The Task work item type is used for monitoring activity and tasks.
  • 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 will trigger three separate flows in Microsoft Power Automate when a ticket is created in Service Manager.

Flow 1: Create a work item in Azure DevOps and store the Service Manager ticket references Flow 2: Create a work item 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

  • You must create a Bug work item in Azure DevOps for the process template used by your DevOps project. Open url.png See the procedure.
  • You must create two custom fields for the Bug work item to store the Service Manager ticket references. Open url.png See the procedure.

Best Practice

BestPractice
  • 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, credentials of your Service Manager platform, etc.
  • Use the search field to find the connectors and actions to be created in the MS Power Automate workflow easily.

    example  Find the actions for the Azure DevOps connector

    Microsoft Power Automate - Best Practice search connector.png

Caution

Caution_TitleActionInPowerAutomateFlow
  • When you create workflow actions in Microsoft Power Automate, you must rename them as indicated in the procedure. This is because certain items of information in the name refer to the title of the action. If you do not respect the naming convention, the workflow will not be triggered correctly.

example  The split(body('Analyze_Ticket_Info')'')?['AVAILABLE_FIELD_6'],',') instruction refers to the action called Analyze Ticket Info

Note: Spaces in the title will automatically be replaced by the underscore _.

Integration process

 Prerequisite  Ask EasyVista to create two fields in the SD_REQUEST table which will be specific to Azure DevOps and GitHub. Add them to the ticket form. Open url.png See the detailed procedure.

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

2. Create the two custom fields for the Bug work item to store the Service Manager ticket references. Open url.png See the detailed procedure.

3. Create the MS Power Automate flows.

     Open url.png See the step-by-step integration process.

  • Note: This requires a connection to Azure DevOps.

Best Practice icon.png  Import the preconfigured flows below containing all of the steps to MS Power Automate. Open url.png See the procedure for importing flows.
        Download icon.png  Flow Create a work item in Azure DevOps

         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

4. In Service Manager, create a Bug Work Item resource used in a REST step of a process. Open url.png See the detailed procedure.

Step-by-Step Integration Process

AddDevOpsFieldsInTicketForm_Procedure

Add fields specific to Azure DevOps and GitHub to the SD_REQUEST table

Step 1: Ask EasyVista to add fields to the database

1. Ask EasyVista to add the following two fields.

  • Field called E_ADO_NUMBER, nvarchar data type, size 20. This will store the ID of the Azure DevOps work item associated with the Service Manager ticket.
  • Field called E_PR_NUMBER, nvarchar data type, size 20. This will store the number of the GitHub pull request associated with the Service Manager ticket.
     

Step 2: Add fields to the Ticket forms, i.e. Incident and Request forms

     Open url.png See the detailed procedure

1. Open each Ticket form, i.e. Incident and Request forms.

2. Click Browse grey points icon.png in the top banner and select Edit Form.
The main form presentation will appear.

3. Select and place the two fields in the form.

4. Click Save and click Save and Close.

The form will be refreshed.
         Add fields DevOps in ticket form.png

Create the Bug work item type

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

CreateBugWorkItemType_Procedure

Step 1: Log in to Azure DevOps

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

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.

EndCreateBugWorkItemType_Procedure


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

CreateEZVFieldsForBugWorkItem_Procedure

1. Select the Bug work item type.

2. 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.

EndCreateEZVFieldsForBugWorkItem_Procedure

Import the workflow to Microsoft Power Automate

Note: This requires a connection to Azure DevOps.

Step 1: Download the flow

1. Download the relevant file below to your workstation.

        Download icon.png  Flow Create a work item in Azure DevOps

         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

ImportFlowInMicrosoftPowerAutomate_Procedure

Step 2: Import the flow to Microsoft Power Automate 

1. Log in to the Microsoft Power Automate website using your account credentials.

2. Click My flows in the left pane.

A list of your MS Power Automate flows will appear.
         Microsoft Power Automate - Import flow - Flow list.png

3. Click Import in the menu bar and select the file you downloaded.

  • Once imported, the package contents will appear.
  • The Red nok icon.png icon indicates that the connection for the resource was not found.
    Microsoft Power Automate - Import flow - Package content.png

 

Step 3: Create the connections required for the flow

1. Click the Select during import link in the Import Setup column for the relevant resource.

          Microsoft Power Automate - Import flow - Import setup link.png

The window for configuring the import will appear.
         Microsoft Power Automate - Import flow - Import setup window.png

2. Create a new connection for the resource or select an existing connection.

There is an existing connection for the resource

  • Select the connection.
  • Click Save.
    Microsoft Power Automate - Import flow - Import setup - Select existing connection.png

There is no existing connection for the resource

  • Click + Create.
    Microsoft Power Automate - Import flow - Import setup - Create connection.png
    • An MS Power Automate instance will appear in a new Web browser tab.
    • The list of existing connections will appear.
               Microsoft Power Automate - Import flow - Import setup - Create connection 2.png
  • Click + New connection.
  • Find the connection you want using the search field and select it from the list.

example  Find the GitHub connection

Microsoft Power Automate - Import flow - Import setup - Create connection 3.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 connection for the resource will appear in the list.

example  New GitHub connection

Microsoft Power Automate - Import flow - Import setup - New connection added.png

  • Close your Web browser tab.
    You will return to the tab displaying the details of the imported package.
  • Click Refresh List.
    The new connection for the resource will appear in the window for configuring the import.
             Microsoft Power Automate - Import flow - Import setup - Refresh list.png
  • Select the connection and click Save.
    The Black cross icon.png icon indicates that the connection for the resource has been correctly established.
             Microsoft Power Automate - Import flow - Import setup - New connection ok.png

3. Repeat the procedure for each connection required for the flow.
 

Step 4: Import package resources

1. Click Import.

          Microsoft Power Automate - Import flow - Button.png

The Green ok icon.png icon next to each package resource indicates that the flow has been correctly imported.
         Microsoft Power Automate - Import flow - Ok.png

Step 5: Configure package resources

Note: You should perform this step if a message at the top of the page informs you that package resources must be configured.

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

         Microsoft Power Automate - Import flow with error - 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 Power Automate - Import flow with error - Invalid connection.png

2. Click the action indicating an invalid connection.

The list of all existing connections for the selected type of resource will appear.
         Microsoft Power Automate - Import flow with error - Invalid connection - Select connection.png

2. Click the connection defined for the type of resource.

The properties of the action will appear. The properties displayed depend on the type of resource.

example  Unspecified properties for an action using the Azure DevOps resource

Microsoft Power Automate - Import flow with error - Invalid connection - Configure connection.png

3. Specify the connection information for the action.

example  Properties for an action using the Azure DevOps resource

  • Organization Name: Select the name of your organization.
  • Project Name: Select the name of your DevOps project.

4. Repeat the procedure for each action indicating an invalid connection.

5. Click Save.

  • The error message for the action will disappear.

example  Action for the Azure DevOps resource

Microsoft Power Automate - Import flow with error - Invalid connection - Configure connection ok.png

  • You have configured all of the connections required for the flow.
  • The workflow will be created.
             Microsoft Power Automate - Import flow - Success.png

 

Step 6:  Configure the workflow

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

          Microsoft Power Automate - Open flow.png

The workflow will appear.
         Microsoft Power Automate - 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
  • Step 2: Create a Bug work item in Azure DevOps to store the Service Manager ticket references
  • Step 3: Store the Bug work item ID in the Service Manager ticket
  • Step 4: Save the configuration of the workflow


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 that will trigger the workflow.

Microsoft Power Automate - Trigger - When a http request is received.png
  • 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.
  • 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 Bug work item in Azure DevOps to store the Service Manager ticket references

1. Create a Create a work item action (Azure DevOps  connector).

Microsoft Power Automate - Action - Create a work item Azure DevOps.png
  • 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: Enter the following value.
      concat(triggerBody()?['id'],' ',triggerBody()?['Priorite'],' ',triggerBody()?['Title'])
    • Description: Description of the Service Manager ticket. Select the dynamic value called Description from the When a HTTP request is received step.


Step 3: Store the Bug work item ID in the comment field of the Service Manager ticket

1. Create a HTTP action to update the Service Manager ticket.

Microsoft Power Automate - Action - HTTP Put.png
  • Rename it Update Ticket using Browse black points icon.png in the title bar.
  • 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.


Step 4: Save the configuration of the workflow

1. Click Save at the bottom of the flow.

          Azure flow 1 - Save configuration.png

Create MS Power Automate flow 2

Description of the Create a work item associated with a specific parent item workflow

Azure flow description - Creation Azure DevOps work item.png
  • Step 1: Create the step that will trigger the flow
  • Step 2: Create a Bug work item in Azure DevOps to store the Service Manager ticket references
  • Step 3: Associate the Bug work item with a parent work item
  • Step 4: Save the configuration of the workflow


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 that will trigger the workflow.

Microsoft Power Automate - Trigger - When a http request is received.png
  • 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.
  • 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 Bug work item in Azure DevOps to store the Service Manager ticket references

1. Create a Create a work item action (Azure DevOps  connector).

Microsoft Power Automate - Action - Create a work item Azure DevOps.png
  • 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: Enter the following value.
      concat(triggerBody()?['id'],' ',triggerBody()?['Priorite'],' ',triggerBody()?['Title'])
    • Description: Description of the Service Manager ticket. Select the dynamic value called Description from the When a HTTP request is received step.


Step 3: Associate the Bug work item with a parent work item

1. Create an Update a work item action (Azure DevOps  connector).

Microsoft Power Automate - Action - Update a work item Azure DevOps.png
  • Specify the information on the action.
    • Organization Name: Name of your organization.
    • Work Item ID: ID of the Bug work item. Select the dynamic value called ID from the Create a Work Item step.
    • Work Item Type: Select Bug.

    • Advanced options:
      • Link URL: Enter the URL of the Bug work item in the following format. Replace the values highlighted in yellow with the values of your environment.
        https://dev.azure.com/{your_organization}/{your_project}/_apis/wit/workItems/{WorkItem_ID}
      • Link Type: Select the Hierarchy-reverse value.


Step 4: Save the configuration of the workflow

1. Click Save at the bottom of the flow.

          Azure flow 2 - Save configuration.png

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
  • Step 2: Retrieve the ID of the group/user assigned to the Service Manager ticket (Group_ID field)
  • Step 3: Retrieve the status, scheduled end date and group/user assigned from the Service Manager ticket (available_field_6 field)
  • Step 4: Notify any changes made to the Azure DevOps work item in the comment field of the Service Manager ticket
    • Step 4.a: Store changes to the status in the Service Manager ticket
    • Step 4.b: Store changes to the scheduled end date in the Service Manager ticket
    • Step 4.c: Store changes to the group/user assigned in the Service Manager ticket
  • Step 5: Notify any changes made to the Azure DevOps work item in the available_field_6 field of the Service Manager ticket
  • Step 6: Save the configuration of the workflow


Step 1: Create the step that will trigger the flow

==> The flow is triggered when the Bug work item associated with the Service Manager ticket is changed in Azure DevOps.

1. Create a When a Work Item is Updated step (Azure DevOps connector) that will trigger the workflow.

Action Azure - Update Service Manager ticket - When a work item is update - Information.png
  • Specify the information on the trigger.
    • Organization Name: Name of your organization.
    • Project Name: Name of your DevOps project.
    • Type: Select the Bug work item type.
  • Save the trigger.

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


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

1. Create a HTTP step to find the group stored in the Service Manager ticket.

Microsoft Power Automate - Action - HTTP Get.png
  • Rename it Get Info Group ID HTTP using Browse black points icon.png in the title bar.
  • Specify the information on the action.
    • Method: Enter the GET value.
    • URI: Enter the following expression.
      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. Create a JSON Analysis action to retrieve information on the group.

Microsoft Power Automate - Action - Parse JSON.png
  • Rename it Parse JSON Get Group ID using Browse black points icon.png in the title bar.
  • Specify the information on the action.
    • Contents: 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 from the Service Manager ticket (available_field_6 field)

1. Create a HTTP step to find the Service Manager ticket.

Microsoft Power Automate - Action - HTTP Get.png
  • Rename it Get Info Ticket HTTP using Browse black points icon.png in the title bar.
  • Specify the information on the action.
    • Method: Enter the GET value.
    • URI: Enter the following expression.
      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. Create a JSON Analysis action to retrieve information on the Service Manager ticket.

Microsoft Power Automate - Action - Parse JSON.png
  • Rename it Parse JSON Get Group ID using Browse black points icon.png in the title bar.
  • Specify the information on the action.
    • Contents: 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. Define the following variables by creating Initialize variable actions in the order listed below to retrieve the status, scheduled end date and group/user assigned from the available_field_6 field.

Microsoft Power Automate - Action - Initialize variable.png
Variable 1: To store the ID of the Azure DevOps work item
  • Rename the action Initialize variable Available Field 6 using Browse black points icon.png in the title bar.
  • Specify the information on the action.
    • Name: Enter the Field6 value.
    • Type: Select the Array value.
Variable 2: To store the number of the Service Manager ticket
  • Rename the action Initialize variable RFC NUMBER using Browse black points icon.png in the title bar.
  • Specify the information on the action.
    • Name: Enter the RFC_NUMBER value.
    • Type: Select the String 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 Azure DevOps work item in the comment field of the Service Manager ticket

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


Step 4.a: Store changes to the status in the Service Manager ticket

1. Create a Condition action to check changes to the status.

Flow 3 - Condition change Status - Line condition.png
  • Rename it Condition State using Browse black points icon.png in the title bar.
  • Click Add to add the following line to the condition.
Value tested Condition line
Status changed
  • Select Value: Enter the instruction below.
    variables('Field6')[0]
  • Comparator: Select is not equal to.
  • Value: Enter the instruction below.
    @triggerOutputs()?['body/fields/System_State']

2. Define the actions to be performed when the status is changed in the Azure DevOps work item (conditions for the Condition State action).

  • Go to the If Yes branch.
  • Select Add an action to add the following actions.

3. Create an Apply to each action.

Flow 3 - Condition change - Apply to each action.png
  • Specify the information on the action.
    • Select an output from previous steps: Enter the instruction below.
      @{body('Analyse_JSON_Get_Info_Group_ID')?['records']}

4. Create a HTTP action to store the changed status in the comment field of the Service Manager ticket.

Note: action_type_id = 95: ID of the Internal Note value 

Flow 3 - Condition change status - HTTP Post.png
  • Rename it POST Internal Note State HTTP using Browse black points icon.png in the title bar.
  • Specify the information on the action.* Method: Enter the POST value.
    • URI: Enter the following expression.
      concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'requests/',triggerOutputs()?['body/fields/Custom_EZV_ID'],'/tasks')
    • Body: Copy and paste the JSON schema below.
      { "action_type_id": "95", "group_id": "@{items('Appliquer_à_chacun')?['GROUP_ID']}", "comment": "ADO : Change of State '@{triggerOutputs()?['body/fields/System_State']}' " }
    • Advanced options:
      • Authentication: Select the Basic value.
      • Username: Service Manager platform account.
      • Password: Password of the Service Manager platform account.


Step 4.b: Store changes to the scheduled end date in the Service Manager ticket

1. Create a Condition action to check changes to the scheduled end date.

Flow 3 - Condition change Date - Line condition.png
  • Rename it Condition Date using Browse black points icon.png in the title bar.
  • Click Add to add the following line to the condition.
Value tested Condition line
Scheduled end date changed
  • Select Value: Enter the instruction below.
    variables('Field6')[1]
  • Comparator: Select is not equal to.
  • Value: Select the Date value.
Scheduled end date specified
  • Select Value: Enter the instruction below.
    @triggerOutputs()?['body/fields/Microsoft_VSTS_Scheduling_TargetDate']
  • Comparator: Select is not equal to.
  • Value: Select the null value.

2. Define the actions to be performed when the scheduled end date is changed in the Azure DevOps work item (conditions for the Condition Date actions).

  • Go to the If Yes branch.
  • Select Add an action to add the following actions.

3. Create an Apply to each action.

Flow 3 - Condition change - Apply to each action.png
  • Specify the information on the action.
    • Select an output from previous steps: Enter the instruction below.
      @{body('Analyse_JSON_Get_Info_Group_ID')?['records']}

4. Create a HTTP action to store the changed date in the comment field of the Service Manager ticket.

Note: action_type_id = 95: ID of the Internal Note value 

Flow 3 - Condition change date - HTTP Post.png
  • Rename it POST Internal Note Date HTTP using Browse black points icon.png in the title bar.
  • Specify the information on the action.* Method: Enter the POST value.
    • URI: Enter the following expression.
      concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'requests/',triggerOutputs()?['body/fields/Custom_EZV_ID'],'/tasks')
    • Body: Copy and paste the JSON schema below.
      { "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')}'" }
    • Advanced options:
      • Authentication: Select the Basic value.
      • Username: Service Manager platform account.
      • Password: Password of the Service Manager platform account.


Step 4.c: Store changes to the group/user assigned in the Service Manager ticket

1. Create a Condition action to check changes to the group/user assigned.

Flow 3 - Condition change assignation - Line condition.png
  • Rename it Condition Assigned To using Browse black points icon.png in the title bar.
  • Click Add to add the following line to the condition.
Value tested Condition line
Group/user assigned changed
  • Select Value: Enter the instruction below.
    variables('Field6')[2]
  • Comparator: Select is not equal to.
  • Value: Select the Assigned To value.
Group/user assigned specified
  • Select Value: Enter the instruction below.
    @triggerOutputs()?['body/fields/System_AssignedTo']
  • Comparator: Select is not equal to.
  • Value: Select the null value.

2. Define the actions to be performed when the group/user assigned is changed in the Azure DevOps work item (conditions for the Condition Assigned To actions).

  • Go to the If Yes branch.
  • Select Add an action to add the following actions.

3. Create an Apply to each action.

Flow 3 - Condition change - Apply to each action.png
  • Specify the information on the action.
    • Select an output from previous steps: Enter the instruction below.
      @{body('Analyse_JSON_Get_Info_Group_ID')?['records']}

4. Create a HTTP action to store the changed group/user assigned in the comment field of the Service Manager ticket.

Note: action_type_id = 95: ID of the Internal Note value 

Flow 3 - Condition change assignation - HTTP Post.png
  • Rename it POST Internal Note Assigned HTTP using Browse black points icon.png in the title bar.
  • Specify the information on the action.* Method: Enter the POST value.
    • URI: Enter the following expression.
      concat(triggerOutputs()?['body/fields/Custom_EZV_URI'],'requests/',triggerOutputs()?['body/fields/Custom_EZV_ID'],'/tasks')
    • Body: Copy and paste the JSON schema below.
      { "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 5: Notify any changes made to the Azure DevOps work item in the available_field_6 field of the Service Manager ticket

1. Create a Condition action to check changes to the Azure DevOps work item.

Action Azure - Update Service Manager ticket - Condition Update Ticket - Information.png
  • Rename it Condition Update Ticket using Browse black points icon.png in the title bar.
  • Click Add to add the following lines to the condition.
Value tested Condition line
Status changed
  • Select Value: Enter the instruction below.
    variables('Field6')[0]
  • Comparator: Select is not equal to.
  • Value: Enter the instruction below.
    @triggerOutputs()?['body/fields/System_State']
Scheduled end date changed
  • Select Value: Enter the instruction below.
    variables('Field6')[1]
  • Comparator: Select is not equal to.
  • Value: Enter the instruction below.
    @triggerOutputs()?['body/fields/Microsoft_VSTS_Scheduling_TargetDate']
Group/user assigned changed
  • Select Value: Enter the instruction below.
    variables('Field6')[2]
  • Comparator: Select is not equal to.
  • Value: Enter the instruction below.
    @triggerOutputs()?['body/fields/System_AssignedTo']

2. Define the actions to be performed when changes are made to the Azure DevOps work item (conditions for the Condition Update Ticket actions).

  • Go to the If Yes branch.
  • Select Add an action to add the following action.

3. Create a HTTP action to store changes in the available_field_6 field of the Service Manager ticket.

Action Azure - Update Service Manager ticket - Put Update Ticket HTTP - Information.png
  • Rename it POST Internal Note Assigned HTTP using Browse black points icon.png in the title bar.
  • Specify the information on the action.* Method: Enter the PUT value.
    • URI: Enter the following expression.
      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.


Step 6: Save the configuration of the workflow

1. Click Save at the bottom of the flow.

          Azure flow 3 - Save configuration.png

Service Manager: Create a resource called Bug Work Item used in a REST step of a process

Notes:

  • The Bug Work Item resource will enable to create a Bug work item in Azure DevOps when a ticket is created in Service Manager.
  • It is associated with a Microsoft Power Automate service.
  • It is used in a Service Manager process using a REST action type.
CreateInServiceManagerRestResource_Procedure

Step 1: Manage rights for using the Service Manager REST API

1. Select Administration > Access Management > User Profiles in the menu.

2. Select a user profile authorized to use the Service Manager REST API.

3. Tick the REST API box.

Your changes will automatically be saved.

4. Repeat the procedure for all authorized profiles.

Step 2: Create a resource called Bug Work Item associated with a Microsoft Power Automate service

        Open url.png See the detailed procedure.

Step 2.a: Create a service called Microsoft Power Automate

1. Select Administration > REST > Services in the menu.

2. Create a new service.

          New REST service - None authentication.png

3. Specify the information below.

  • Service Name: Enter the label Microsoft Power Automate.
  • Authentication Method: None.
  • Service URL: URL for accessing the new Microsoft Power Automate service.
    • Copy and paste the URL you stored in your text editor when creating the MS Power Automate flow (step that will trigger the flow).
    • You should keep only the text displayed in yellow below.

      https://prod-55.westeurope.logic.azure.com:443/workflows/a903f9140a874277be8b9dd39b5c4305/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=R-FJw5q_MEn-I-98MNF794bVtN91QIWFt8gixg-8

    • Replace prod-55.westeurope with {subdomain}.
       

Step 2.b: Create a connection to the Microsoft Power Automate service.

1. Create a new connection.

          New REST connection - None authentication.png

2. Specify the information below.

  • Connection Name: Enter the label Azure DevOps.
  • Authentication Method: None.
  • Service Name: Select the Microsoft Power Automate service you created at step 2.a.
    The URL of the service will automatically appear.
  • subdomain: Copy and paste the prod-55.westeurope value of the URL you stored in your text editor.
     

Step 2.c: Create a resource associated with the Microsoft Power Automate service

1. Create a new resource.

          New REST resource - None authentication.png

2. Specify the information below.

  • Label: Enter the label Bug Work Item.
  • Resource URI: ID of the new resource.
    • Copy and paste the URL you stored in your text editor when creating the MS Power Automate flow (step that will trigger the flow).
    • You should keep only the text displayed in yellow below.

      https://prod-55.westeurope.logic.azure.com:443/workflows/a903f9140a874277be8b9dd39b5c4305/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=R-FJw5q_MEn-I-98MNF794bVtN91QIWFt8gixg-8

  • Contents: Body of the query containing the data to be updated. Copy and paste the text below without inserting any spaces or line breaks.

Caution: If you paste a JSON schema copied from a third-party editor such as Microsoft Word or Notepad++, invisible characters may be inserted. This will create an error in the processing of the REST step using the resource.

{"Description": "{Description}","id": "{id}","Host": "{sys.EVSM_HOST}","URL": "{sys.EVSM_REST_SERVICE_URL}","Account": "{sys.EVSM_ACCOUNT}","Title": "{Title}"}

Step 3: Use the Bug Work Item resource in a REST step of a process

1. Open the workflow or the business rule-related process you want.

  • Workflow: References > Other References > Workflows (Operation/Transition)
  • Business rule: Administration > Business Rules > Related Processes

2. Click and drag the new Bug Work Item resource from the REST Actions category of the palette of action types to the graphic editor of the process.

A new step will be added to the process.

          New REST action in workflow - Add in GUI.png

3. Double-click to define the properties of the new step.

          New REST action in workflow - Properties.png

4. Click Confirm Changes.

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 in Azure DevOps

         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:
Powered by XWiki © EasyVista 2022