# Jenkins

## Introduction

Explore the integration between Auto Mate and Jenkins, detailing the available actions in Auto Mate for interacting with Jenkins functionalities.

This document delves into the seamless integration between Auto Mate, a powerful workflow automation platform, and Jenkins, an open-source automation server used for continuous integration and continuous delivery (CI/CD) to build, test, and deploy software projects. It provides insights into the actions within Auto Mate that empower users to interact with the diverse functionalities offered by Jenkins.

## What is Jenkins?

Jenkins is an open-source automation server that helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery (CI/CD). Here are its key features:

* **Plugin Ecosystem:** Jenkins can be extended through a vast array of plugins to support building, deploying, and automating any project.
* **Scalable Build Distribution**: Jenkins supports distributed builds, allowing multiple machines to run build jobs, speeding up the process.
* **Version Control Integration**: Jenkins integrates with numerous version control systems like Git, SVN, and Mercurial to automatically trigger builds on code changes.
* **Automated Notifications and Reporting**: Jenkins can send build notifications and reports via email, Slack, and other channels, keeping teams informed of build statuses and results.

## Autom Mate Integration with Jenkins

With the help of Autom Mate, you can trigger your jobs seamlessly. While triggering the job you can make them wait for an approval or send the new codes to the test before they got migrated.

## Using the Integration

### Credentials

To use Jenkins actions in Autom Mate, you need to create credentials. Follow these steps:

1. **Access Vault Page:**
   * Navigate to the Vault page under the Management section in the left side menu.
2. **Application Credentials:**
   * Ensure you are on the Application Credentials tab on the left side.
   * Search for Jenkins using the filter or manually.
   * Alternatively, click on the "New App Credentials" button at the top left side of the window to create new credentials.

<figure><img src="/files/r7UEpjoaXcbCm9WMwiPH" alt=""><figcaption></figcaption></figure>

3. **Provide Credentials:**
   * **Connector Name:** Unique name for the connector.
   * **Authentication Type:** Choose the method you want to connect.
   * **URL:** URL of the Jenkins instance.
   * **Username:** Username of the user which will do the API Calls.
   * **API Token:** The API Token of the user provided above.
4. **Connect Credentials:**
   * After filling the fields, press on "Test Connect". This option will try to send a API call to "{jenkins\_url}/user/{username}/api/json" to see if the credentials are working. If you get a success response you can press to the "Connect & Create" button to save the credential.

## How To Use Actions

### Trigger Job

<figure><img src="/files/4K8NI0gdELGXCx9njoby" alt=""><figcaption></figcaption></figure>

**Description:** This action will trigger a job that you have in your Jenkins instance.

**Purpose**: To trigger a job in a automated environment after doing some prechecks.

**Usage**: To trigger a job, provide the following input parameters.

* **Job (Required)**: Choose the correct  job you want to trigger from the drop-down list.

**Action Result**: The job you choose will be triggered.

***

### View Jobs

<figure><img src="/files/fd2L3jb74WRBgkGktejl" alt=""><figcaption></figcaption></figure>

**Description**: This action will fetch all the jobs in the provided Jenkins instance.

**Purpose**: To fetch all the jobs.

**Usage**: There is no input field available for this action.

**Action Result:** It will bring all the jobs in a json body. For example:

```
{
    "_class": "hudson.model.Hudson",
    "jobs": [
        {
            "_class": "org.jenkinsci.plugins.workflow.job.WorkflowJob",
            "name": "Mail Test",
            "url": "http://localhost:8443/job/Mail%20Test/",
            "color": "red"
        },
        {
            "_class": "org.jenkinsci.plugins.workflow.job.WorkflowJob",
            "name": "Test item",
            "url": "http://localhost:8443/job/Test%20item/",
            "color": "notbuilt"
        }
    ]
}
```

***

## Additional Tips

### [**Use Cases**](/userguide/use-cases.md)

### [FAQ](/userguide/faq.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autommate.com/userguide/libraries/integration/jenkins.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
