Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create JSON File

Below we will create an Approval Policy and define Approval Routes for qTest Record Types; : qTest Test Case, Automated Test Case, and qTest Test Run.

  1. Create a new JSON file and add a Revision number, Version number, and Schema save . Save the file as VeraAPTutorial-part1.json.:

    Code Block
    languagejson
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        }
    }

Info

Policy Revision revision management was introduced in Vera 2023.2. You still need to include a Revision and Version number to upload policies. The Version number can be used as a reference number. The Revision number is managed by Vera. The Revision number in the file is ignored when uploading policies.

Create Approval Groups

Approval Groups are a list of Approval Roles approval roles that will be used later as Approval Tasks in the Approval Routes.

  1. Add the Approval Groups Business, Technical, and Quality:

    Code Block
    languagejson
          "Approval Groups": [
            "Business",
            "Technical",
            "Quality"
          ]

    Here is the updated Approval Policy with above code block:

    Code Block
    languagejson
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ]
      }
    }

Create

...

Route Template

Approval Route Templates define the approval tasks and approval order. Record Types and Constraints are used to associate an Approval a Route Template to one or more Record Types. We will create a Default Approval Template for qTest records.

  1. Add an Approval a Route Template Name , as Default Approval.:

    Code Block
        "Route Templates": [
          {
            "Name": "Default Approval"
          }
        ] 

    Here is the updated Approval Policy with above code block:

    Code Block
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ],
        "Route Templates": [
          {
            "Name": "Default Approval"
          }
        ]
      }
    }
  2. Add a Rank to the Approval Route Template. Rank determines the order Approval Route Templates are evaluated when a Record is routed for approval. Mutually exclusive Approval Route Templates that do not have overlapping Reocrd Record Types or Constraints can have the same Rank. Later, when we add additional Approval Route Templates, we will use Rank to ensure Approval Route Templates are evaluated in the correct order to ensure the correct Approval Route Template is matched to the Record. Set Rank with to a value of 1.:

    Code Block
            "Rank": "1"

    Here is the updated Approval Policy with above code block:

    Code Block
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ],
        "Route Templates": [
          {
            "Name": "Default Approval",
            "Rank": "1"
          }
        ]
      }
    }
  3. Add an optional element, Prevent Author Approval. When this option is set to true the qTest Test Case or qTest Test Run Author is not authorized to approve the record even if they have the correct approval role. The Author was defined in the Records Management Policy in the previous sections. Add Prevent Author Approval and set to true.:

    Code Block
            "Prevent Author Approval": true

    Here is the updated Approval Policy with above code block:

    Code Block
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ],
        "Route Templates": [
          {
            "Name": "Default Approval",
            "Rank": "1",
            "Prevent Author Approval": true
          }
        ]
      }
    }
  4. Add the Record Types to the Approval Route Template. The Record Types are defined in the Records Management Policy. Enter the Record Types that should be associated with the Route Template. We will add qTest Test Case, Automated Test Case, and qTest Test Run Record Types.:

    Code Block
            "Record Types": [
              "qTest Test Case",
              "Automated Test Case",
              "qTest Test Run"
            ] 

    Here is the updated Approval Policy with above code block:

    Code Block
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ],
        "Route Templates": [
          {
            "Name": "Default Approval",
            "Rank": "1",
            "Prevent Author Approval": true,
            "Record Types": [
              "qTest Test Case",
              "Automated Test Case",
              "qTest Test Run"
            ]
          }
        ]
      }
    }
  5. Add Constraints to the Route Template. Right now we only have one Route Template in the Approval Policy which will be used for all Record Types so there are no constraints.

    Code Block
            "Constraints": [] 

    Here is the updated Approval Policy with above code block:

    Code Block
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ],
        "Route Templates": [
          {
            "Name": "Default Approval",
            "Rank": "1",
            "Prevent Author Approval": true,
            "Record Types": [
              "qTest Test Case",
              "Automated Test Case",
              "qTest Test Run"
            ],
            "Constraints": []
          }
        ]
      }
    }
  6. Add Levels to the Route Template. Levels contain one or more Levels approval levelswith one or more Approvers. The Approvers are defined in the Approve Approval Groups element of the Approval Policy. We recommend using Level # pattern for Levels. Approvers in the same Level can complete their approval tasks in any order. All approvals must be complete completed before Approvers in subsequent Levels can be completed. The Default Approver route template will have 3 three Approvers, : Technical and Business can approve in any order, then after those Approvers that there is a Quality Approver on Level 2.:

    Code Block
            "Levels": [
              {
                "Name": "Level 1",
                "Approvers": ["Technical","Business"]
              },
              {
                "Name": "Level 2",
                "Approvers": ["Quality"]
              }
            ] 

    Here is the updated Approval Policy with above code block:

    Code Block
    {
      "Revision": "1",
      "Approval Policy": {
        "Version": "Vera Tutorial 1",
        "Schema": {
          "ID": "http://tx3services.com/schemas/0/0/approval-policy.json",
          "Major": "0",
          "Minor": "0"
        },
        "Approval Groups": [
          "Business",
          "Technical",
          "Quality"
        ],
        "Route Templates": [
          {
            "Name": "Default Approval",
            "Rank": "1",
            "Prevent Author Approval": true,
            "Record Types": [
              "qTest Test Case",
              "Automated Test Case",
              "qTest Test Run"
            ],
            "Constraints": [],
            "Levels": [
              {
                "Name": "Level 1",
                "Approvers": ["Technical","Business"]
              },
              {
                "Name": "Level 2",
                "Approvers": ["Quality"]
              }
            ]
          }
        ]
      }
    }

Now we have an Approval Policy configured for qTest integration. The completed JSON file with the Default Approval Route Template can be downloaded here:

View file
nameVeraAPTutorial-part1.json

...