Ensuring data privacy while leveraging AI-powered automation in Jira is essential for many organizations. The Private AI Mode in AI Issue Breakdown Assistant for Jira allows you to use your own AI model as an issue generation engine, ensuring that sensitive data remains within your controlled environment. This guide will walk you through the steps to configure Private AI Mode using a Groovy script for the integration.
Private AI Mode enables you to integrate your own AI model, hosted within your data center, to handle issue generation. This setup ensures that all data processing happens internally, enhancing data privacy and security. The integration is achieved through a Groovy script that defines the communication protocol with the AI engine.
Before configuring Private AI Mode, ensure you have the following:
If you haven’t already, install the AI Issue Breakdown Assistant for Jira app from the Atlassian Marketplace. Follow these steps:
Once the app is installed, follow these steps to configure Private AI Mode:
Here’s an example Groovy script to integrate with OpenAI GPT-4o, which you can modify for your AI model:
import com.atlassian.jira.util.json.*
def payload = new JSONObject() // Prepare body as per API specification
.put("model", "gpt-4o")
.put("messages", new JSONArray()
.put(new JSONObject()
.put("role", "user")
.put("content", query)))
.put("temperature", 1.0)
.toString();
def post = new URL("<https://api.openai.com/v1/chat/completions>").openConnection() // Create a new request to specified URL
logger.debug("Preparing POST body: " + payload)
post.setConnectTimeout(60000) // Set a timeout to 60 seconds - make sure to always set timeouts
post.setReadTimeout(60000); // Set a timeout to 60 seconds - make sure to always set timeouts
post.setRequestMethod("POST") // Specify HTTP method
post.setDoOutput(true) // Specify our HTTP request has a body
post.setRequestProperty("Content-Type", "application/json") // Set HTTP header
post.setRequestProperty("Authorization", "Bearer REPLACE_ME") // Set HTTP header
post.getOutputStream().write(payload.getBytes("UTF-8")) // Set HTTP body
def postRC = post.getResponseCode() // Send POST request
def response = post.getInputStream().getText() // Read response body
logger.debug("Response code is: " + postRC + "; Response body is: " + response)
if (postRC.equals(200)) { // Verify request is successful
def json = new JSONObject(response) // Read as JSON
def result = json.getJSONArray("choices").getJSONObject(0).getJSONObject("message").get("content") // Traverse JSON tree
return result // This script must always return the produced issues
}
throw new Exception("Unsuccessful request! HTTP response code is " + postRC + "; Response body is: " + response) // Throw error due to unsuccessful request
When writing the script, please ensure you follow these best practices:
throw new Exception("An error has occurred...")
.query
to access the issue content.After configuring Private AI Mode, it’s crucial to test the setup:
Troubleshooting Tips:
com.deview_studios.atlassian.jira.dc.ai_issue_generator
and set the logging level to DEBUG.logger.debug
to log messages in the script and check the Jira logs for any errors.Configuring Private AI Mode in AI Issue Breakdown Assistant for Jira enhances data privacy and security by ensuring all AI processing occurs within your infrastructure. By following these steps and using the provided Groovy script, you can integrate your own AI model seamlessly. For more detailed documentation and support, visit the AI Issue Breakdown Assistant for Jira documentation page.
We extend various collaboration platforms by developing native integrations and applications. Our mission is to create best-in-class productivity tools for small and large businesses.