This documentation supports the 21.02 version of BMC Helix Innovation Studio.

To view an earlier version, select the version from the Product version menu.

Setting up a process to automatically trigger a Jenkins job

As an application business analyst, create a process by using the Run Jenkins Job, Get Jenkins Job Build, and Get Queue Item elements in the Process designer of BMC Helix Innovation Studio to automatically trigger a Jenkins job.

Before you begin

Make sure that an administrator has configured the Jenkins connector.

Run Jenkins Job element properties

A Run Jenkins Job element triggers a Jenkins job.

The following table describes the Run Jenkins Job input properties:

PropertyDescription
Connection IDID of the Jenkins connector.
Job

Location of the Jenkins job.

Specify the job location in one of the following ways:

  • Specify a path that includes the Jenkins project name.
    For example, SBE/01_Developer_Jobs/Test Sleep 
  • Specify the Jenkins job name.
    For example, Test Sleep
  • Specify the sub path of the Jenkins job.
    For example, job/SBE/job/01_Developer_Jobs/job/Test Sleep
ParametersParameters that you want to pass to the Jenkins job.
Delay in secondsTime interval to delay the start of the Jenkins job.

The following table describes the Run Jenkins Job output properties:

PropertyDescription
Queue Item ID 

ID of an item in the Jenkins queue.

It is an integer value. For example, 149634.

Get Jenkins Job Build element properties

A Get Jenkins Job Build element retrieves the build details of a Jenkins job.

The following table describes the Get Jenkins Job Build input properties:

PropertyDescription
Connection IDID of the Jenkins connector.
Job

Location of the Jenkins job.

Specify the the job location in one of the following ways:

  • Specify a path that includes the Jenkins project name.
    For example, SBE/01_Developer_Jobs/Test Sleep 
  • Specify the Jenkins job name.
    For example, Test Sleep
  • Specify the sub path of the Jenkins job.
    For example, job/SBE/job/01_Developer_Jobs/job/Test Sleep
Build IDBuild ID of the Jenkins job.

The Get Jenkins Job Build output property is a JSON that provides information such as job location, build ID, and result.

For example,

{
"result": "SUCCESS",
  "id":
"483",
  "url":
"http://<host name>:8080/job/SBE/job/01_Developer_Jobs/job/Test%20Sleep/483/",
"building": false,
"status": null
} 

Get Queue Item element properties

A Get Queue Item element retrieves the ID of an item in a Jenkins queue.

The following table describes the Get Queue Item input properties:

PropertyDescription
Connection IDID of the Jenkins connector.
Queue Item ID

ID of an item in the Jenkins queue.

You can map the output of Run Jenkins Job element to this field.

The Get Queue Item output property is a JSON that provides information such as job location and build ID.

For example,

{
  "id":
"152645", 
"executable": {   
"number": 483,   
"url": "http://clm-aus-000479.bmc.com:8080/job/SBE/job/01_Developer_Jobs/job/Test%20Sleep%20with%20Params/483/"
  }, 
"others": null, 
"inQueueSince": 1617290746546
} 

To create a process to automatically trigger a Jenkins job

  1. Log in to BMC Helix Innovation Studio.
  2. Navigate to the Workspace tab, and select the application in which you want to create a process.
  3. In the application, select Processes, and click New.
    The system opens the Process designer.
  4. Drag the Run Jenkins Job element to the canvas and enter values of the element properties.
  5. If required, add the Get Jenkins Job Build element and other elements, and enter the element properties.
  6. Specify the flow of execution and save the process.

Example: Setting up a process to automatically trigger a Jenkins job

Ajay is an application business analyst in Calbro Services. He wants to automate the task of triggering a Jenkins job. To automate the task, he creates a process. Ajay uses the Create Document element to access attributes within the schema of the JenkinsParameters document definition. He add the values for the document nodes and uses these values as input to the run the Jenkins job. Ajay uses the Run Jenkins Job element to trigger the job.

Ajay performs the following actions to create the process to automate the triggering of a Jenkins job:

  1. Create the process as shown in the following image:
  2. Add the Create Document element properties as shown in the following image:

    1. To add a document, select the JenkinsParameters document definition as shown in the following image:

    2. To add values for the document nodes, click Add/Remove Document Nodes, and select the key and value check boxes of nodes as shown in the following image:

    For information about the Create Document element, see Creating a document instance.

  3. Add the Run Jenkins Job element properties as shown in the following image:
  4. In the Run Jenkins Job element properties, in the Parameters field, map the Create Template element output as shown in the following image:

  5. Save the process.

Related topics

Process variables and data types

Managing processes by using the Manage Processes dashboard

Was this page helpful? Yes No Submitting... Thank you

Comments