mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-04 04:07:54 +00:00
Change in method name for creating an issue on JIRA (#3307)
The awesome JIRA tool created by @zywilliamli calls the `create_issue()` method to create issues, however, the actual method is `issue_create()`. Details in the Documentation here: https://atlassian-python-api.readthedocs.io/jira.html#manage-issues
This commit is contained in:
parent
e933be9605
commit
d2f922f525
@ -159,7 +159,7 @@ class JiraAPIWrapper(BaseModel):
|
|||||||
"json is not installed. " "Please install it with `pip install json`"
|
"json is not installed. " "Please install it with `pip install json`"
|
||||||
)
|
)
|
||||||
params = json.loads(query)
|
params = json.loads(query)
|
||||||
return self.jira.create_issue(fields=dict(params))
|
return self.jira.issue_create(fields=dict(params))
|
||||||
|
|
||||||
def other(self, query: str) -> str:
|
def other(self, query: str) -> str:
|
||||||
context = {"self": self}
|
context = {"self": self}
|
||||||
|
@ -6,4 +6,12 @@ OPENAI_API_KEY=
|
|||||||
# your api key from left menu "API Keys" in https://app.pinecone.io
|
# your api key from left menu "API Keys" in https://app.pinecone.io
|
||||||
PINECONE_API_KEY=your_pinecone_api_key_here
|
PINECONE_API_KEY=your_pinecone_api_key_here
|
||||||
# your pinecone environment from left menu "API Keys" in https://app.pinecone.io
|
# your pinecone environment from left menu "API Keys" in https://app.pinecone.io
|
||||||
PINECONE_ENVIRONMENT=us-west4-gcp
|
PINECONE_ENVIRONMENT=us-west4-gcp
|
||||||
|
|
||||||
|
|
||||||
|
# jira
|
||||||
|
# your api token from https://id.atlassian.com/manage-profile/security/api-tokens
|
||||||
|
# more details here: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html
|
||||||
|
# JIRA_API_TOKEN=your_jira_api_token_here
|
||||||
|
# JIRA_USERNAME=your_jira_username_here
|
||||||
|
# JIRA_INSTANCE_URL=your_jira_instance_url_here
|
24
tests/integration_tests/utilities/test_jira_api.py
Normal file
24
tests/integration_tests/utilities/test_jira_api.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
"""Integration test for JIRA API Wrapper."""
|
||||||
|
from langchain.utilities.jira import JiraAPIWrapper
|
||||||
|
import json
|
||||||
|
|
||||||
|
def test_search() -> None:
|
||||||
|
"""Test for Searching issues on JIRA"""
|
||||||
|
jql = "project = TP"
|
||||||
|
jira = JiraAPIWrapper()
|
||||||
|
output = jira.run("jql", jql)
|
||||||
|
assert 'issues' in output
|
||||||
|
|
||||||
|
def test_getprojects() -> None:
|
||||||
|
"""Test for getting projects on JIRA"""
|
||||||
|
jira = JiraAPIWrapper()
|
||||||
|
output = jira.run("get_projects", "")
|
||||||
|
assert 'projects' in output
|
||||||
|
|
||||||
|
def test_create_ticket() -> None:
|
||||||
|
"""Test the Create Ticket Call that Creates a Issue/Ticket on JIRA."""
|
||||||
|
issue_string = '{"summary": "Test Summary", "description": "Test Description", "issuetype": {"name": "Bug"}, "project": {"key": "TP"}}'
|
||||||
|
jira = JiraAPIWrapper()
|
||||||
|
output = jira.run("create_issue", issue_string)
|
||||||
|
assert 'id' in output
|
||||||
|
assert 'key' in output
|
Loading…
Reference in New Issue
Block a user