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 Setup: Creating a New Project
Once you’ve set up your Jira Service Desk dashboard, you can begin configuring your project.
- Navigate to the Projects tab and click on “Create Project.”
- Select Process Management, assign a project name, and Jira will automatically generate a unique project key.
- Once your project is created, it will appear under the Projects tab.
Configuring Workflow in Jira
Next, configure the workflow for your project.
- Click on the Issues tab located on the right corner of the screen.
- Under the Workflows section, select Edit Workflow.
- 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.
- In the workflow editor, click on the transition you want to apply the script to.
- Click on Post Functions, then select Add Post Function.
- Choose Script Post-function [ScriptRunner].
- 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:
- Click the Settings icon and select Issues.
- Under the Fields section, choose Custom Fields and add the required fields for your project.
- Select the field type and fill in the necessary data for each field.
Next, set up approvals for your project:
- In the Manage Apps section, click on Approvals and add your project for approval.
- 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.
- From the Jira dashboard, go to Manage Apps and configure your Rundeck settings.
- 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
- 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... - 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.
- Navigate to the Rundeck Job and enter the key value to call the custom field created in the Jira issue.
- 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.



