Jenkins
Jenkins is an open-source automation server that enables developers to build, test, and deploy software through continuous integration and continuous delivery (CI/CD) pipelines.
Authentication Types
Jenkins supports 1 authentication method:
- API Token - Use a personal API token for authentication. Each user connects with their own Jenkins account credentials.
- Pros: Secure, works with all authentication realms (LDAP, SSO, etc.), no CSRF token needed, per-user tracking
- Cons: Requires Jenkins 2.96+ for optimal experience, requires manual token generation per user
General Settings
Before using the connector, you need to configure:
- Jenkins Instance URL - Your Jenkins server URL (e.g.,
https://jenkins.company.comorhttps://ci.mycompany.io)
Make sure to include the protocol (https:// or http://) in your instance URL. Do not include a trailing slash.
Setting up API Token
1. Generate an API Token in Jenkins
-
Log in to your Jenkins instance with your credentials
-
Click on your username in the top right corner
-
Click Configure in the left sidebar (or navigate to
https://your-jenkins-instance/me/configure) -
Scroll down to the API Token section
-
Click Add new Token
-
Enter a descriptive name for the token (e.g., "Webrix Integration" or "AI Assistant Access")
-
Click Generate
-
Copy the token immediately - it will only be shown once
The API token is only displayed once. If you lose it, you'll need to revoke it and generate a new one.
2. Prepare Your Credentials
Jenkins API authentication requires HTTP Basic Auth with your username and API token. You need to format your credentials as:
username:apiToken
For example, if your username is john.doe and your API token is abc123def456, your credential string should be:
john.doe:abc123def456
3. Configure in Webrix
-
In Webrix, navigate to Integrations → New → Built-in
-
Select Jenkins
-
In General Settings, enter your Jenkins Instance URL
-
In Authentication, paste your credentials in the format
username:apiToken -
Click Save Changes
-
Click Connect to verify the connection
Your username is your Jenkins login username, not your display name or email address. You can find it in your Jenkins profile.
Troubleshooting
403 Forbidden Error
Cause: Invalid credentials, incorrect username, or expired/revoked API token.
Solution:
- Verify that you're using your Jenkins username (not email or display name)
- Ensure the API token is correct and hasn't been revoked
- Generate a new API token and try again
- Check that your Jenkins account has appropriate permissions
Invalid Instance URL
Cause: The Jenkins instance URL is malformed or unreachable.
Solution:
- Ensure the URL includes the protocol (
https://orhttp://) - Remove any trailing slashes from the URL
- Verify you can access the Jenkins web interface at that URL
- Check that the Jenkins server is accessible from Webrix (not blocked by firewall)
Job Not Found Error
Cause: The job name is incorrect, especially for nested jobs in folders.
Solution:
For jobs nested in folders, use forward slashes to separate folder names:
folder-name/subfolder-name/job-name
For example:
- Correct:
production/backend/deploy-api - Incorrect:
production-backend-deploy-api
You can verify the correct path by checking the job's URL in Jenkins - the path segments after /job/ are what you need.
Permission Denied Error
Cause: Your Jenkins user account lacks necessary permissions for the requested operation.
Solution:
Ensure your Jenkins user has the appropriate permissions:
- Read - View jobs, builds, and configuration
- Build - Trigger builds
- Configure - Modify job configuration
- Delete - Delete jobs
- Cancel - Stop running builds
Contact your Jenkins administrator to grant the necessary permissions. Jenkins uses role-based access control (RBAC) which can be configured through matrix-based security or role plugins.
Pipeline API Tools Not Working
Cause: The Pipeline REST API plugin is not installed.
Solution:
The pipeline-specific tools (Get Pipeline Runs, Get Pipeline Run Details, etc.) require the Pipeline: REST API plugin. Ask your Jenkins administrator to install it from:
Manage Jenkins → Manage Plugins → Available Plugins → Search for "Pipeline REST API"
Alternatively, you can use the standard build tools which work for all job types including pipelines.
Security Considerations
API tokens have the same permissions as your user account. Store tokens securely and rotate them periodically.
Best Practices:
- Generate separate tokens for different integrations or applications
- Use descriptive names when generating tokens to track their usage
- Revoke unused tokens regularly through your Jenkins profile
- Never share tokens - each user should generate their own
- Use minimal permissions - request your Jenkins admin to grant only necessary permissions to your account
- Rotate tokens periodically as part of your security policy
Common Use Cases
Monitoring Build Status
Use "Get Build Status" to check if a build succeeded or failed, and "Get Console Output" to view logs when debugging failures.
Triggering Deployments
Use "Trigger Parameterized Build" to start deployment jobs with specific parameters like environment, version, or branch.
Managing Build Queue
Use "Get Build Queue" to see what's waiting to build, and "Cancel Queued Item" to remove builds that are no longer needed.
Debugging Pipelines
For pipeline jobs, use "Get Pipeline Run Details" to see the status of each stage, and "Get Pipeline Node Log" to view stage-specific logs.
Checking Build Capacity
Use "List Nodes" to see all available build agents and their executor counts, helping identify capacity issues.