Skip to main content
Skip table of contents

Trigger build remotely with AgileTest

Before proceeding with this section, make sure you have completed the CI/CD Integration for your workspace. For more details, please refer to the document - CI/CD Tools Integration.

In many cases, users need to build and run regression tests to verify bug fixes, validate new feature implementations, or even before merging code into the main branch. However, the YAML file is often not configured for these unscheduled tests. As a result, users frequently need to open the CI/CD tool and manually trigger the pipeline. To simplify this process, Agile Test allows users to trigger builds remotely, directly from the Test Execution screen.

image (5)-20241030-084628.png

Typical flow with Agile Test

To access this feature, go to Agile Test setting in your project by choosing Settings → Automated Test.

image-20241022-070106.png

Trigger configuration screen

On this screen, you should see most common CI/CD tools, Bitbucket, GitHub, GitLab, and Jenkins. By default, these settings would be disabled.

After enabling one of these platform, a New configuration button will appear for you to create new triggers.

Trigger configuration

Bitbucket

Firstly, click New Bitbucket Configuration button to reveal the configuration dialog.

User is required to fill in details as follows.

Please refer to this document to learn more about Bitbucket parameters - Run a pipeline with parameters.

  • Trigger Name: New trigger name.

  • Workspace: Your Bitbucket workspace.

  • Repository Slug: aka repo-slug, you can find it in your repository url https://bitbucket.org/ <workspace-id>/<repo-slug>

  • Body Data: we support Bitbucket parameters.

    • Example:

JSON
{
    "target": {
      "commit": {
        "type": "commit",
        "hash": "32fe523af85fe828ab97c70eb816ae1c9956d7b4"
      },
      "ref_type": "branch",
      "type": "pipeline_ref_target",
      "ref_name": "nunit"
    }
}
  • Repository Access Token: the access token of the current repository. To get one, please refer to this document from Jira Create a Repository Access Token.

  • Additional Parameters: additionally, we support extra params.

Additional params

Description

Milestone id

The id number of a milestone. User could copy it directly from Milestone screen.

Test plan key

Test plan issue key

Test environment

A string contains a list of Test environments separated by “,”. Use endpoint /ds/test-environments, to get this id

Revision

Source code version used in the test execution

FixVersion

Fix Version linked with the test execution

To learn more about our API endpoints, please refer to this API doc from us API documentation.

These fields are required only when a user creates a Test Execution without linking a Milestone, Test Plan, Test Environment, Revision, or Fix Version.

If the user has already provided these details, Agile Test will take them into account during the triggering process. The following cases may occur:

  • Field values already linked to the triggering Test Execution ticket: These values will be ignored.

  • Field values different from those linked to the triggering Test Execution ticket: The new values will be appended.

GitHub

Firstly, click New GitHub Configuration button to reveal the configuration dialog.

User is required to fill in details as follows.

Please refer to this document from GitHub for more details - Create a workflow dispatch event.

  • Trigger Name: New trigger name.

  • GitHub Owner: A string of your GitHub account name.

  • Repository Name: A string of the current repository.

  • Branch Name: A string of the branch on which we are going to trigger the workflow.

  • Inputs: This field allows users to add custom variables to send along with the triggering request. In most cases, it won't be necessary. However, in certain situations, it can be useful for integrating with additional setups in your GitHub workflow.

  • Access Token: A string of your Personal Access Token. To get one please refer to this document from GitHub Managing your personal Access Tokens.

  • Additional Parameters: additionally, we support extra params → Please go to Additional params.

GitLab

Firstly, click New Gitlab Configuration button to reveal the configuration dialog.

User is required to fill in details as follows.

Please refer to this document from GitLab for more details Trigger a pipeline with a token.

  • Trigger Name: New trigger name.

  • GitLab Project ID: A string of your GitLab project id. To get project id from GitLab main page go to Projects → Open your project → Copy project ID.

  • Branch Name: A string of the branch on which you want to trigger build.

  • Variables: This field allows user to add any custom variables to send along with triggering request. In most cases, you would not need it. However, in some special cases, it may provide a way to collaborate with further setups in your GitLab pipeline.

  • Pipeline Trigger Token: A string of your Pipeline trigger token. To create one please refer to this document from GitLab Create a trigger Token.

  • Additional Parameters: additionally, we support extra params → Please go to Additional params.

Jenkins

In Agile Test, we support 2 types of Jenkins jobs: Pipeline and MultiBranch.

  • Trigger Name: New trigger name.

  • Jenkins Username: A string of your Jenkins username.

  • Remote Jenkins URL: The URL to your Jenkins server, where you will run builds, e.g. http://jenkins_url.

  • Job Name: A string of the job which we are going to trigger.

  • Branch Name (only available for MultiBranch setting): Name of the branch on which we are going to trigger the pipeline.

  • Parameters: This field allows you to add custom variables when triggering a request. It's generally not required, but in some special cases, it can be useful for additional setups in your Jenkins jobs.

  • API Token: A string of your Jenkins API token.

To create a new API Token in your Jenkins instance, please follow these steps.

  1. Log in to Jenkins.

  2. Click your name (upper-right corner).

  3. Click Configure (left-side menu).

  4. Click Add API Token.

  • Additional Parameters: additionally, we support extra params → Please go to Additional params.

Execute build remotely

This step applies to any CI/CD configuration. Once the trigger setup is complete, open a Test Execution ticket.

On the right panel of the issue screen, under the Agile Test section, you will see the trigger you just created. Simply click Run to start your pipeline.

The context area of Agile Test where user could choose a preconfigured trigger

If everything is working correctly, clicking the Refresh button will display a confirmation message indicating that the pipeline has been triggered successfully.


Should you need any assistance or further AgileTest inquiries, please contact us here!

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.