Running a Jenkins job
To add the Run a Jenkins Job action to a policy
- In the BMC Helix Intelligent Automation console, click Policies and the click Create Automation Policy.
- In the Policy Information section, enter a unique name and an optional description for the policy.
- Select Manual or Automatic depending upon whether you want to execute the policy manually or automatically based on the incoming events.
- In the Trigger section, click Browse and perform one of the following steps to select an event:
- From the Select Event Type tab, select an existing event type, and click Done.
On the Paste Event JSON tab, enter event in the JSON format, and click Done.
{
"Resource": "ES",
"ResourceType": "Disk",
"Alarm": "on"
}
In the Trigger Condition text box, build the following expression to match the trigger condition to the event:
$.event.Resource == 'ES' && $.event.ResourceType == 'Disk' && $.event.Alrm == 'on'- To add system or custom tags to the policy, perform the following steps:
- System tags: Select one or more tags from the list of available system tags.
Based on the event, some system tags are displayed. - Custom tags: In the Tags (Optional) section, enter a key-value pair.
Tag key should start with an alphabet and end with an alphanumeric character. Key supports alphanumeric characters and periods, dashes, and underscores.
- System tags: Select one or more tags from the list of available system tags.
- To add action to the policy, click Add Action and perform the following steps by using the action wizard:
- From the Pick an automation tool section, click the connector name.
Only configured connectors are displayed here. The wizard takes you to the next step to select an action. - Click Select against Generic REST Action.
The action name is displayed. - From the HTTP Method list, select POST.
- In the API Path, provide the path for the job that you want to execute when the event matches the trigger condition in the policy.
For example, <host:port>/view/IA-Jenkin-Actions/job/IA-ES-MinFreeSpace-Alarm-Action/buildWithParameters. In the Query params section, provide the following values for each of the parameters.
Field
Value
Type
Specify the type as Query.Valid values: Query, Path, Header, Cookie
Key
Specify the key as Token.
Value
Provide the value that matches the key.
- (Optional) If you want to specify a request body, select the Content type as JSON and paste the JSON in the body area.
- Click Done.
The added action appears in the Action Configuration section on the Create Automation Policies page.
- From the Pick an automation tool section, click the connector name.
- In the Estimated Savings section, enter an approximate time (in minutes) and money (in USD) that you may save by automating this action.
- Select Publish Policy and click Save to publish the policy.
This policy runs every time an event that matches the trigger conditions appears in BMC Helix Intelligent Automation.