First of all: The function “Jira Automation with Jira Edge Connector” is relatively new, there is currently little information, documentation and examples available for free. However, we would like to take a look at this function soon so that we can evaluate interesting use cases at an early stage. This is a first attempt and test run, please take this into account.
The Jira Edge Connector (JEC) is an advanced tool designed to bridge the gap between (Atlassian Cloud) Jira Service Management and various on-premises systems or cloud environments. It enables users to automate tasks and workflows by running scripts in response to Jira events, thereby enhancing the integration capabilities of Jira. Here’s an look at how to utilize JEC for automation.
Understanding Jira Edge Connector (JEC)
JEC is a lightweight application that supports multiple scripting languages, including Groovy, Python, Go, PowerShell, shell scripts, and batch files. This flexibility allows you to write custom scripts that can be executed when specific events occur in Jira Service Management. JEC can be deployed both on-premises and in cloud environments, providing a versatile solution for different infrastructure needs (Atlassian Documentation) (Atlassian Support).
Key Features and Setup
Script Execution: JEC allows you to trigger scripts based on Jira automation rules. These scripts can perform a wide range of tasks, from simple notifications to complex integrations with other IT systems.
Environment Variables and Arguments: JEC supports the use of environment variables and arguments passed to scripts. This feature ensures that your scripts have access to the necessary data and configurations to perform their tasks effectively.
Git Integration: JEC can pull configuration files, scripts, and credentials from a Git repository. This integration ensures version control and simplifies the management of your automation scripts (Atlassian).
To use the Jira Edge Connector (JEC), certain requirements must be met regarding the product, licensing, and setup. Here are the details:
Product Requirements:
Jira Service Management (JSM): JEC is designed to work with Jira Service Management. Ensure you have Jira Service Management set up as part of your Atlassian cloud or on-premises environment.
Supported Scripting Languages: JEC supports Groovy, Python, Go, PowerShell, shell scripts, and batch files. Ensure that your environment can run these scripts.
Licensing Requirements:
Jira Service Management Premium or Enterprise Plans: The JEC feature is available for Jira Service Management on Premium and Enterprise plans. This is necessary to access advanced automation and integration features (Atlassian Support).
API Access: Ensure that you have the necessary API access permissions to create and manage API keys, which are essential for configuring JEC to connect with Jira (Atlassian Support) (Atlassian).
Permissions:
Admin Permissions in Jira: To configure and manage JEC, you need administrative permissions in Jira. This includes permissions to create and manage automation rules, configure integrations, and manage API keys (Atlassian Support) (Atlassian).
Technical Environment:
Server or Cloud Environment: JEC can be deployed on-premises or in a cloud environment. Ensure that the environment where JEC will be running meets the necessary system requirements and has network access to both Jira Service Management and any other integrated systems.
By meeting these requirements, you can effectively leverage the Jira Edge Connector to enhance your Jira Service Management with powerful automation and integrations. For detailed setup instructions and configuration examples, refer to the official Jira Edge Connector documentation and the Atlassian support pages.
What does our test setup look like?
1. Configure the Jira Automation
Create the Automation Rule: In Jira, go to Automation and select "Create rule". Choose the "Run script using Jira Edge Connector" action. Create a new API key and save it (which we will need later in the JEC configuration file).
Enter “createIssue” under “Action name” and add the desired “Key-value pairs”. Note: You can use Smart values here, this is not documented anywhere, but it works! You can also store static values in the same way. My configuration:
2. Install and Configure the Jira Edge Connector on your external System
Install the JEC: according to the following instructions
Configure JEC: Add the API key to the JEC configuration file under the apiKey field. Define the action mappings in the actionMappings section, specifying the script to run and any necessary arguments (Atlassian Support). My configuration:
file: /home/jsm/jec/conf/jec-config.json
{
"apiKey": "PUT-YOUR-API-KEY-HERE",
"baseUrl": "https://api.atlassian.com",
"logLevel": "DEBUG",
"globalArgs": [],
"globalFlags": {
},
"actionMappings": {
"createIssue": {
"filepath": "/home/jsm/jec/scripts/example.py",
"sourceType": "local",
"env": [],
"stdout": "/home/jsm/jec/output/outputCreateIssue.txt"
},
"createIssue2": {
"filepath": "/home/jsm/jec/scripts/example2.py",
"sourceType": "local",
"env": [],
"stdout": "/home/jsm/jec/output/outputCreateIssue2.txt"
},
"addComment": {
"filepath": "/home/jsm/jec/scripts/jec_action_executor.py",
"sourceType": "local",
"env": [],
"stdout": "/home/jsm/jec/output/output.txt"
}
},
"pollerConf": {
"pollingWaitIntervalInMillis": 100,
"visibilityTimeoutInSec": 30,
"maxNumberOfMessages": 10
},
"poolConf": {
"maxNumberOfWorker": 12,
"minNumberOfWorker": 4,
"monitoringPeriodInMillis": 15000,
"keepAliveTimeInMillis": 6000,
"queueSize": 0
}
}
4. Create a Python script that is to be executed by the JEC and processes the data from Jira. My script only receives the payload and outputs the information:
file: /home/jsm/jec/scripts/example.py
import argparse
import json
import logging
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-payload', '--payload', help='Payload from JSM', required=True)
parser.add_argument('-apiKey', '--apiKey', help='API Key', required=True)
parser.add_argument('-jsmUrl', '--jsmUrl', help='JSM URL', required=True)
parser.add_argument('-logLevel', '--logLevel', help='logLevel', required=True)
parser.add_argument('-jecNamedPipe', '--jecNamedPipe', type=str, help="Path of Named Pipe to write callback context", required=False)
parser.add_argument('-example-configured-arg', '--example-configured-arg', help='example-configured-arg', required=False)
args = vars(parser.parse_args())
logging.basicConfig(stream=sys.stdout, level=args['logLevel'])
payload_string = args.get("payload")
payload_string = payload_string.strip()
payload = json.loads(payload_string)
def readValue(key):
return payload.get(key)
logging.info(readValue("issueKey"))
logging.info(readValue("issueSummary"))
logging.info(readValue("category"))
logging.info(readValue("startDate"))
3. Test run
I create a task, which triggers the Jira Automation rule and transfers the data to my external system. The JEC on my external system executes the Python script and writes the following to my log file:
INFO:root:P1-14
INFO:root:My Test Issue
INFO:root:Category 2
INFO:root:2024-07-30
This is the data that we previously declared as a key-value pair in the automation rule.
Optionally, we can of course now return data via the JIRA API or simply report that the data has been received correctly.
Once again: This is a simple test.
3. Possible use cases
User Account Provisioning
Use Case: Automate the creation and management of user accounts based on Jira requests.
Details: When a new employee onboarding request is submitted, trigger a script to create accounts in Active Directory, provision necessary resources, and send confirmation back to Jira.
Notification and Alerting Systems
Use Case: Enhance notifications by integrating with external alerting systems.
Details: Trigger notifications through SMS, email, Slack, or Microsoft Teams when specific events occur in Jira. Scripts can ensure that critical updates reach the right stakeholders promptly.
IT Asset Management
Use Case: Synchronize IT asset data between Jira and asset management tools.
Details: When an asset-related issue is logged in Jira, trigger a script to update asset information in an external CMDB (Configuration Management Database) or asset management tool. This ensures consistent and up-to-date asset data across systems.
Customer Support Automation
Use Case: Enhance customer support by integrating with external CRM systems.
Details: Automatically create or update customer support tickets in CRM systems like Salesforce based on Jira Service Management incidents. Additionally, customer information from the CRM can be pulled into Jira for context.
Automated Security Responses
Use Case: Respond to security alerts by executing remediation scripts.
Details: When a security incident is logged in Jira, trigger a script to isolate affected systems, update firewall rules, or notify the security team through additional channels like Slack or email.
Integration with CI/CD Pipelines
Use Case: Integrate Jira with CI/CD tools to automate build and deployment processes.
Details: On issue status changes (e.g., moving to "In Progress"), trigger scripts to start a build in Jenkins or GitLab CI, run tests, and deploy code. The results can be posted back to the Jira issue for tracking.
Automated Incident Resolution
Use Case: Automatically resolve incidents by executing scripts that interact with monitoring tools.
Details: When a monitoring tool detects an issue, a script can be triggered to collect diagnostic information, apply fixes, and then update the incident status in Jira. For example, restarting a service or clearing a log file.
Conclusion
The Jira Edge Connector (JEC) is a powerful tool that significantly enhances the capabilities of Jira Service Management by enabling seamless integration with various external systems and automation scripts. This functionality allows organizations to automate complex workflows, improve incident management, enhance security responses, and streamline customer support and IT asset management processes. By executing scripts and transferring data between Jira and other systems, JEC helps maintain consistency, improve efficiency, and ensure real-time synchronization of information across different platforms. As organizations increasingly seek to optimize their operations through automation, the flexibility and extensibility provided by JEC make it an invaluable asset for modern IT environments. Proper implementation, security considerations, and robust error handling are essential to leverage the full potential of JEC and achieve seamless integration across diverse systems.
An important note at this point: The implementation is still relatively new. From our point of view, there is currently very little information material and documentation, but hopefully this will change in the near future. We think that it will then become clear (or clearer) which use cases can best be implemented and how.
For more detailed guidance and examples, refer to the Atlassian documentation and support articles.
Comments