Jira Issue Creation
Implement an execution action that enables Glean Assistant to create Jira issues programmatically with proper user attribution
Overview
This guide explains how to create an execution action that allows Glean Assistant to create Jira issues on behalf of users. The implementation uses OAuth-based authentication and ensures proper user attribution for created issues.
Prerequisites
Before beginning this implementation, ensure you have:
- Administrator access to your Jira and Glean instances
- Familiarity with OAuth 2.0 authentication flows
- Basic understanding of API implementation
- Access to necessary development resources
Action Manifest Configuration
The first step involves creating an action manifest that defines the core properties of your Jira integration. This manifest establishes the fundamental characteristics and authentication requirements of your action.
We use the OAUTH_ADMIN
authentication type because Jira’s cloud API supports using admin tokens to create issues on behalf of other users. This approach simplifies the authentication flow while maintaining proper user attribution.
Server Implementation
The server implementation handles requests from Glean’s actions backend and manages the creation of Jira issues. This implementation includes proper security measures and ensures accurate user attribution.
API Specification
The OpenAPI specification defines how Glean Assistant interacts with your action server. This specification provides clear guidance for field population and ensures consistent behavior.
Implementation Considerations
Security and Authentication
The implementation incorporates several security measures that protect your Jira integration:
First, the OAuth configuration uses admin-level authentication, which provides centralized control while maintaining individual user attribution. This approach simplifies token management while ensuring proper access controls.
Second, the server implementation validates all incoming requests and enforces proper user attribution. The Glean-User-Email
header ensures that issues are created with the correct reporter, maintaining accountability and traceability.
User Attribution
The user attribution system works through several mechanisms:
The server retrieves the appropriate Jira account ID for each user by matching their email address. This process ensures that issues appear in Jira with the correct reporter, maintaining accurate audit trails and user accountability.
The implementation handles cases where users might not be found in Jira, preventing issues from being created without proper attribution. This safeguard maintains data integrity within your Jira instance.
Error Handling
The implementation includes comprehensive error handling that addresses common scenarios:
- Authentication failures receive appropriate error responses with clear messages
- Missing or invalid user information is caught and handled gracefully
- Jira API errors are properly captured and communicated back to users
- Network issues and timeouts are managed appropriately
Performance Optimization
Several measures ensure optimal performance of the Jira integration:
The implementation uses efficient user lookup mechanisms, implementing pagination for user searches to handle large organizations effectively. The code includes proper request timeouts and connection pooling to manage resources effectively.
The API specification includes type hints that help Glean Assistant populate fields correctly the first time, reducing the need for repeated attempts or corrections.
Maintenance Requirements
To maintain the integration effectively:
- Monitor OAuth token usage and implement proper rotation schedules
- Track API usage against Jira rate limits
- Maintain up-to-date user mappings
- Review and update API specifications as needed
- Monitor error rates and user feedback
Troubleshooting Guide
When issues arise, investigate these common areas:
-
Authentication Issues
- Verify OAuth token validity
- Check scope configurations
- Confirm user permissions
-
User Attribution Problems
- Verify email mapping functionality
- Check Jira user account status
- Confirm proper header parsing
-
Performance Concerns
- Monitor response times
- Check rate limit usage
- Review connection pooling settings
Next Steps
After implementing the Jira integration:
- Create comprehensive user documentation
- Establish monitoring and alerting systems
- Set up regular maintenance schedules
- Plan for feature enhancements
- Configure backup and recovery procedures
Was this page helpful?