Services DevOps DevSecOps Cloud Consulting Infrastructure Automation Managed Services AIOps MLOps DataOps Microservices 🔐 Private AINEW Solutions DevOps Transformation CI/CD Automation Platform Engineering Security Automation Zero Trust Security Compliance Automation Cloud Migration Kubernetes Migration Cloud Cost Optimisation AI-Powered Operations Data Platform Modernisation SRE & Observability Legacy Modernisation Managed IT Services 🔐 Private AI DeploymentNEW Products ✨ ZippyOPS AINEW 🛡️ ArmorPlane 🔒 DevSecOpsAsService 🖥️ LabAsService 🤝 Collab 🧪 SandboxAsService 🎬 DemoAsService Bootcamp 🔄 DevOps Bootcamp ☁️ Cloud Engineering 🔒 DevSecOps 🛡️ Cloud Security ⚙️ Infrastructure Automation 📡 SRE & Observability 🤖 AIOps & MLOps 🧠 AI Engineering 🎓 ZOLS — Free Learning Company About Us Projects Careers Get in Touch

Integrating Jira with Rundeck for SQL Queries Automation

Integrating Jira with Rundeck for SQL Queries Automation

Introduction

In this tutorial, we will walk you through integrating Jira with Rundeck for automating SQL queries. This combination allows your team to streamline operations and reduce manual effort in executing database-related tasks directly from Jira issues.

Jira with Rundeck integration for automated SQL queries execution

Jira Setup: Creating a New Project

Once you’ve set up your Jira Service Desk dashboard, you can begin configuring your project.

  1. Navigate to the Projects tab and click on “Create Project.”
  2. Select Process Management, assign a project name, and Jira will automatically generate a unique project key.
  3. Once your project is created, it will appear under the Projects tab.

Configuring Workflow in Jira

Next, configure the workflow for your project.

  1. Click on the Issues tab located on the right corner of the screen.
  2. Under the Workflows section, select Edit Workflow.
  3. In the workflow management page, create a custom workflow by adding statuses and transitions to suit your project’s needs.

Adding a Script Post-Function

To integrate Rundeck with Jira, you will need to add a custom script post-function.

  1. In the workflow editor, click on the transition you want to apply the script to.
  2. Click on Post Functions, then select Add Post Function.
  3. Choose Script Post-function [ScriptRunner].
  4. Select Custom Script Post-function and add the following curl command to trigger the Rundeck job: def cmd = "curl -u devsat:zippyops http://192.168.5.118:8080/plugins/servlet/rundeck?issueKey=${issue.key}" def proc = cmd.execute()

This script will automatically trigger the specified Rundeck job whenever the defined Jira transition is executed.

Adding Custom Fields in Jira with Rundeck

For tracking additional project data, create custom fields within Jira:

  1. Click the Settings icon and select Issues.
  2. Under the Fields section, choose Custom Fields and add the required fields for your project.
  3. Select the field type and fill in the necessary data for each field.

Next, set up approvals for your project:

  1. In the Manage Apps section, click on Approvals and add your project for approval.
  2. Configure roles and administrators for the approval process.

Rundeck Setup: Automating SQL Queries

With your Jira setup complete, now let’s move to configuring Rundeck.

  1. From the Jira dashboard, go to Manage Apps and configure your Rundeck settings.
  2. In your Rundeck project, define the format: JiraProjectKey:RundeckProjectName|RundeckJobName.

For example: RUN:sqlquery|jirasqlquery

Installing the Atlassian CLI

To automate the task in Rundeck, download and install the Atlassian CLI:

  • Visit: Atlassian CLI Downloads and download version 9.0.0.
  • Unzip and save the package in the following path: /var/lib/rundeck.

Configuring the Script in Rundeck

  1. Save the following script (test.sh) under /var/lib/rundeck/projects/sqlquery/: #!/bin/bash issue=RUN-12 status=$(java -jar /var/lib/rundeck/atlassian-cli-9.0.0/lib/acli-9.0.0.jar --server http://192.168.5.118:8080 --user "user" --password "password" --action getFieldValue --issue "$issue" --field "Status" | tail -1) # Additional script actions...
  2. This script will fetch the issue status, retrieve associated data (like the database name, email, and file), and execute the SQL query if approved.

Monitoring Job Execution

After setting up the Rundeck job, you can monitor its execution directly in Jira.

  1. Navigate to the Rundeck Job and enter the key value to call the custom field created in the Jira issue.
  2. Under the Workflow tab, link the job and track its status in the Activity section.

ZippyOPS: Streamlining DevOps Automation

ZippyOPS provides consulting, implementation, and managed services to help organizations streamline their DevOps, DevSecOps, DataOps, and MLOps operations. Our expertise in cloud solutions, automated operations, and microservices can help you fully automate your Jira and Rundeck integrations.

Whether you need assistance with infrastructure setup, security, or building scalable solutions, ZippyOPS has you covered. Explore more of our services and solutions:

For tailored support, reach out to us at sales@zippyops.com.


Conclusion for Integrating Jira with Rundeck

Integrating Jira with Rundeck for SQL query automation can significantly enhance your team’s efficiency and reduce manual effort. By automating processes directly from Jira, you can ensure consistent execution of tasks while maintaining complete control over your workflow. With ZippyOPS’s consulting services, you can easily implement this integration and more to elevate your operations.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top