Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

OpenAPI Integration for Jira Conversational Agents: Authentication Issue

Hi everyone,

I'm developing a conversational agent and working on integrating it with Jira to open tickets. My schema appears to be correct, as the conversational agent is generating the JSON payload as expected. However, I'm unable to make the request successfully.

I suspect the issue might be related to authentication. I've tried using both Bearer Token authentication and OAuth, but neither approach seems to work. I successfully tested the integration in Postman using Basic Auth (username and API Key), but the Conversational Agent fails to make the API call.

Here’s the schema I’m using:

{
  "openapi": "3.0.0",
  "info": {
    "title": "Jira API - Create Issue",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://jira-test.atlassian.net/rest/api/3"
    }
  ],
  "paths": {
    "/issue": {
      "post": {
        "summary": "Create a Jira Issue",
        "operationId": "createIssue",
        "requestBody": {
          "description": "Details of the issue to be created",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIssueRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Issue successfully created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateIssueResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The payload is invalid."
          },
          "401": {
            "description": "Unauthorized. API key or authentication is missing/invalid."
          },
          "500": {
            "description": "Server error. Something went wrong on Jira's side."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateIssueRequest": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "object",
            "properties": {
              "project": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "example": "PROJ"
                  }
                },
                "required": [
                  "key"
                ]
              },
              "summary": {
                "type": "string",
                "example": "ADD SUMMARY HERE"
              },
              "issuetype": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Task"
                  }
                },
                "required": [
                  "name"
                ]
              }
            },
            "required": [
              "project",
              "summary",
              "issuetype"
            ]
          }
        },
        "required": [
          "fields"
        ]
      },
      "CreateIssueResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "10001"
          },
          "key": {
            "type": "string",
            "example": "PROJ-1"
          },
          "self": {
            "type": "string",
            "example": "https://jira-test.atlassian.net/rest/api/3/issue/10001"
          }
        }
      }
    }
  }
}
 

And here’s a sample payload generated by the model:

{
    "fields": {
        "project": 
        {
            "key": "PROJ"
        },
        "summary": "ADD SUMMARY HERE",
        "issuetype": {
            "name": "Task"
        }
    }
}

Does anyone have any tips on how to successfully open tickets in Jira via this integration? Also, which authentication method is recommended for this use case?

Thanks in advance for your help!

1 5 466
5 REPLIES 5

Hi @EBastiani,

Welcome to Google Cloud Community!

It looks like you're facing an authentication issue with your conversational agent when trying to connect with the Jira API. Although Basic Auth works in Postman, the agent is having trouble with both Bearer Token and OAuth.

Here are potential ways that might help with your use case:

  • API Token: Make sure that the API token you’re using in your conversational agents is properly configured and has the required permissions. 
  • Review Token Validity: Ensure that the access token you’re using is still valid, as tokens have a limited lifespan and may need periodic refreshing.
  • Check Environment Variables: If you're using environment variables for credentials, make sure they are properly referenced and not causing any problems.
  • Review Permissions: Verify that your user account has the required permissions to create an issue in Jira.
  • Compare with Postman: Since you mentioned that the integration works in Postman using Basic Auth, ensure that all the necessary headers and parameters are properly included.
  • Error Handling: You may want to review Jira's response for any specific error messages that might provide more insight into the issue.
  • Logging and Debugging: You may want to implement detailed logging in your conversational agent to capture the full request and response details. This can help identify the source of any issues.

In addition, For the authentication method, I recommend OAuth 2.0, because of its enhanced security and versatility. While Basic Auth is simpler to implement, it is less secure and should be used with caution. Additionally, ensure you're using the Authorization header with the Bearer token for OAuth 2.0.

You may refer to the documentation below, which provides essential information for understanding their Jira integration and authentication, offering practical guidance for applying these concepts to their conversational agent integration. This ensures a better grasp of the setup process, especially the aspects related to authentication configuration:

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

 

Hi!

I'm facing the same issue. Do you manage to solve it ?

Thanks !

Hi, @MelanieG!

Unfortunately, I didn't find any solution to that. However, Google is soon launching the Agentspace. You might want to keep an eye on it.

Take care!

Hi, @EBastiani 
Sounds like an authentication issue. Jira Cloud doesn’t support Bearer Tokens, so you’ll need to use Basic Auth with your email and API token. Also, make sure your API token has the right permissions. Since it’s working in Postman, try generating a cURL request from there and compare it to what your agent is sending. If you’re getting a 401, it’s probably an auth problem.

Unfortunately, Conversational Agents has no Basic Auth 😞