Overview

This guide explains how to implement a redirect action that allows users to create Jira issues through Glean Assistant. Unlike execution actions that create issues programmatically, this approach directs users to Jira’s native interface with pre-populated fields. This implementation maintains the familiar Jira environment while streamlining the issue creation process.

Understanding the Redirect Approach

The redirect implementation for Jira issue creation offers several distinct advantages over direct API integration. When users trigger the action through Glean Assistant, they are directed to Jira’s issue creation interface with relevant information already filled in. This approach provides a seamless experience while leveraging Jira’s native functionality and maintaining user familiarity with the platform.

Action Manifest Implementation

The action manifest defines the fundamental properties of your Jira redirect action. This configuration establishes how the action behaves within the Glean ecosystem.

{
  "type": "ACTION",
  "name": "JiraCreateTicket",
  "description": "This action allows you to create a new issue in Jira. You can specify the project, issue type, and other details.",
  "enablePreview": true,
  "actionType": "REDIRECT"
}

The manifest configuration is intentionally simpler than that of execution actions because redirect actions don’t require OAuth authentication or complex server implementations. This simplicity reduces implementation overhead while maintaining functionality.

API Specification Development

The OpenAPI specification serves as the blueprint for how Glean Assistant interacts with your redirect action. This specification must clearly define all parameters and their behaviors to ensure accurate field population.

openapi: "3.0.0"
info:
  title: "Jira Create Ticket"
  version: "1.0.0"
servers:
  - url: "https://{YOUR-ATLASSIAN-DOMAIN}.atlassian.net/secure/CreateIssueDetails!init.jspa?"
paths:
  /:
    post:
      summary: "Creates an issue or a sub-task from a JSON representation"
      description: |
        This API allows you to create a ticket or an issue in Jira.
      parameters:
        - name: "pid"
          in: "query"
          required: true
          schema:
            type: "string"
            x-glean-typehint: "JiraProjectID"
            default: "10000"
          description: "Project ID where the ticket is created. 10000 refers to Engineering project."
        - name: "issuetype"
          in: "query"
          required: true
          schema:
            type: "integer"
            enum:
              - 10002
              - 10004
          description: "Issue type. 10002 refers to Task, 10004 refers to Bug."
        - name: "priority"
          in: "query"
          schema:
            type: "integer"
            minimum: 1
            maximum: 5
          description: "Numeric priority. 1 (highest) to 5 (lowest)."
        - name: "summary"
          in: "query"
          required: true
          schema:
            type: "string"
            x-glean-typehint: "Content"
          description: "Title of the issue."
        - name: "components"
          in: "query"
          schema:
            type: "string"
            x-glean-typehint: "JiraComponent"
          description: "Component name where the ticket should be filed."
        - name: "description"
          in: "query"
          schema:
            type: "string"
            x-glean-typehint: "Content"
          description: "Body of the issue."
        - name: "assignee"
          in: "query"
          schema:
            type: "string"
            x-glean-typehint: "JiraId"
          description: "User to which the issue is assigned."
      responses:
        '200':
          description: "OK"
          content:
            application/json:
              schema:
                type: "string"

Parameter Configuration Strategy

The specification includes carefully designed parameters that guide Glean Assistant in populating the Jira issue creation form. Each parameter serves a specific purpose and includes clear instructions for value generation.

Project Identification

The project ID parameter (pid) requires specific attention as it determines where issues are created. The specification includes a default value and clear description to ensure proper project targeting. For example, setting “10000” as the Engineering project helps maintain consistent issue organization.

Issue Type Classification

The issue type parameter uses enumerated values to ensure accurate categorization. The specification maps numeric values to specific issue types, such as 10002 for Tasks and 10004 for Bugs. This mapping ensures that issues are properly classified within your Jira instance.

Priority Assignment

The priority parameter implements a numeric scale from 1 to 5, with built-in validation to prevent invalid values. This structured approach maintains consistency with Jira’s priority system while allowing for flexible assignment based on issue urgency.

Content Generation

Content-related parameters like summary and description use the x-glean-typehint: "Content" directive to guide Glean Assistant in generating appropriate text. This hint ensures that generated content matches the expected format and style for Jira issues.

Implementation Guidelines

Several key considerations ensure successful implementation of the Jira redirect action.

Parameter Value Management

The specification implements various methods for managing parameter values effectively:

  1. Default Values: Provide sensible defaults where appropriate to streamline the creation process.
  2. Value Constraints: Use enumerated values and ranges to ensure valid input.
  3. Type Hints: Leverage Glean-specific type hints to guide content generation.
  4. Required Fields: Mark essential parameters as required to ensure complete issue creation.

URL Construction

The redirect action builds URLs that properly integrate with Jira’s interface. This process involves:

  1. Proper parameter encoding to handle special characters and spaces.
  2. Correct ordering of query parameters for optimal compatibility.
  3. Implementation of appropriate parameter separators and delimiters.
  4. Validation of URL length to prevent truncation issues.

Error Prevention

The implementation includes several measures to prevent common issues:

  1. Parameter validation before URL construction
  2. Proper encoding of special characters
  3. Length validation for generated content
  4. Type checking for numeric values

Testing Procedures

A comprehensive testing strategy should verify all aspects of the redirect action’s functionality.

Functional Testing

Verify that:

  1. URLs are properly constructed with all parameters
  2. Field values are correctly populated in Jira’s interface
  3. Required fields are properly enforced
  4. Default values are appropriately applied

Integration Testing

Confirm that:

  1. Redirects function properly across different browsers
  2. Parameter values are properly encoded
  3. Jira’s interface receives and displays all values correctly
  4. The user experience remains smooth and intuitive

User Experience Testing

Evaluate:

  1. The clarity of pre-populated fields
  2. The ease of modifying pre-populated values
  3. The overall flow from Glean Assistant to Jira
  4. The handling of various issue types and priorities

Maintenance Considerations

Regular maintenance ensures continued effectiveness of the redirect action.

Monitoring Requirements

Establish monitoring for:

  1. Successful redirect rates
  2. Parameter population accuracy
  3. User interaction patterns
  4. Error occurrence frequencies

Update Procedures

Maintain the implementation by:

  1. Reviewing and updating parameter configurations
  2. Adjusting type hints based on user feedback
  3. Updating project and issue type mappings
  4. Refining content generation guidance

Conclusion

The redirect action implementation for Jira issue creation provides a robust solution that balances ease of use with functionality. By leveraging Jira’s native interface while streamlining the population of fields, this approach delivers an optimal user experience while maintaining flexibility and familiarity.

Next Steps

To ensure ongoing success with your implementation:

  1. Develop comprehensive user documentation
  2. Establish regular monitoring procedures
  3. Create a feedback collection system
  4. Plan for periodic review and updates
  5. Consider potential feature enhancements

This implementation provides a solid foundation for streamlined issue creation while maintaining the flexibility and familiarity of the Jira interface. Regular monitoring and maintenance will ensure continued effectiveness and user satisfaction.