Using the POST method, you can update the metrics using the GraphQL API of mutation operation type.

Procedure

  1. Get the following credentials from Automation Anywhere Support.
    • CoE Manager user ID
    • CoE Manager password
    • CoE Manager client_id
    • CoE Managerclient_secret
  2. Get the value of the following parameters:
    • Shibumi Base URI: https://app.shibumi.com.
    • Shibumi Enterprise ID: This is the ID of your enterprise.

      Navigate to Admin-Advanced > Additional Settings and copy the value in the Enterprise ID field.

    • Shibumi Program Id: Click the menu (three vertical dots) next to the profile icon and select Info. Copy the value in the ID field.
    • Shibumi App Id: Click the menu (three vertical dots) next to the profile icon and select Info. Copy the value in the App API Name field.
  3. Authenticate by making a POST API call.
    • URL: https://app.shibumi.com/api/oauth2/token?grant_type=password
    • Body type: Form-data
    • Client_id: CoE Manager client_id
    • Client_secret: CoE Manager client_secret
    • Username: CoE Manager username
    • Password: CoE Manager password
    The response should be 200 and will be as shown in the example below:
    {
     "access_token": "eyJhbsdfOiJIUzI1NiJ9.eyJzdWIiOiJzYWlrYXQuc2Fya2FyQGF1dG9tYXRpb25hbnl3aGVyZS5jb20iLCJ0eXBlIjoiT0F1dGgiLCJpYXQiOjE3MzM5OTk0NjQsImV4cCI6MTczNDAwMzA2NH0.hKyWPKdEFUVme90qphEU_HbWZPl31t-vySyefAzNFTs", "expires_in": 3600, "refresh_token": null, "token_type": "bearer"
     }

    Use this access token as a bearer token for the next Post call.

  4. Update data by making a POST call.
    • URL: https://app.shibumi.com/api/4.0/enterprise/89df3968-c93e-42b2-9cb3-6ee3257c3d85/GraphQL/graphQL
    • Access token: Use the access token received from authentication API call.
    • Mutation syntax:
      mutation updateWorkItems(
        $appApiName: String!
        $Process_Type: String!
        $Automation_Id: ID!
        $Success_Count: String!
        $Execution_Time_inSeconds: String!
        $Faliure_Count: String!
        $Start_date: String!
        $End_date: String!
      ) {
        updateWorkItems(
          items: [
            # Execution time metric
            {
              app: $appApiName
              type: $Process_Type
              id: $Automation_Id
              metrics: [
                {
                  metric: "Actual_Automation_Duration_Time_per_Day__m"
                  dataset: "actual__d"
                  value: $Execution_Time_inSeconds
                  start: $Start_date
                  end: $End_date
                }
              ]
            }
            # Success count metric
            {
              app: $appApiName
              type: $Process_Type
              id: $Automation_Id
              metrics: [
                {
                  metric: "Actual_Successful_Executions_per_Day__m"
                  dataset: "actual__d"
                  value: $Success_Count
                  start: $Start_date
                  end: $End_date
                }
              ]
            }
            # Failure count metric
            {
              app: $appApiName
              type: $Process_Type
              id: $Automation_Id
              metrics: [
                {
                  metric: "Actual_Failed_Executions_per_Day__m"
                  dataset: "actual__d"
                  value: $Faliure_Count
                  start: $Start_date
                  end: $End_date
                }
              ]
            }
          ]
        ) {
          id
          url
        }
      }
  5. Input variables: All the variables listed in the table are required.
    Variable Type Description
    appApiName String Application identifier (example, "App_123__app")
    Process_Type String Type of process being tracked (example, "Process__test")
    Automation_Id ID Unique identifier for the automation
    Success_Count String Number of successful executions
    Execution_Time_inSeconds String Duration of execution in seconds
    Faliure_Count String Number of failed executions
    Start_date String Start date for the metrics period (format: YYYY-MM-DD)
    End_date String End date for the metrics period (format: YYYY-MM-DD)
    This mutation updates the following metrics:
    • Automation Duration (Actual_Automation_Duration_Time_per_Day__m): Tracks execution time of the automation process.
    • Successful Executions (Actual_Successful_Executions_per_Day__m): Records count of successful automation runs.
    • Failed Executions (Actual_Failed_Executions_per_Day__m): Records count of failed automation runs.

    All metrics are stored in the actual__d dataset.

{
  "appApiName": "App_123__app",
  "Process_Type": "Process__test",
  "Automation_Id": 4,
  "Start_date": "2025-03-03",
  "End_date": "2025-03-03",
  "Success_Count": "42",  
  "Faliure_Count": "3",
  "Execution_Time_inSeconds": "1800"
}