From c0b732f1f16c129469657012bc4634dfcfa6af82 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Thu, 6 Apr 2023 22:58:13 +0530 Subject: [PATCH] chore: rename project name to project key (#731) --- apiserver/plane/api/views/importer.py | 6 +++--- apiserver/plane/utils/importers/jira.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apiserver/plane/api/views/importer.py b/apiserver/plane/api/views/importer.py index 5f1824033..a1c6c212a 100644 --- a/apiserver/plane/api/views/importer.py +++ b/apiserver/plane/api/views/importer.py @@ -65,12 +65,12 @@ class ServiceIssueImportSummaryEndpoint(BaseAPIView): ) if service == "jira": - project_name = request.data.get("project_name", "") + project_key = request.data.get("project_key", "") api_token = request.data.get("api_token", "") email = request.data.get("email", "") cloud_hostname = request.data.get("cloud_hostname", "") if ( - not bool(project_name) + not bool(project_key) or not bool(api_token) or not bool(email) or not bool(cloud_hostname) @@ -84,7 +84,7 @@ class ServiceIssueImportSummaryEndpoint(BaseAPIView): return Response( jira_project_issue_summary( - email, api_token, project_name, cloud_hostname + email, api_token, project_key, cloud_hostname ), status=status.HTTP_200_OK, ) diff --git a/apiserver/plane/utils/importers/jira.py b/apiserver/plane/utils/importers/jira.py index a5888e2ec..b427ba14f 100644 --- a/apiserver/plane/utils/importers/jira.py +++ b/apiserver/plane/utils/importers/jira.py @@ -3,33 +3,33 @@ from requests.auth import HTTPBasicAuth from sentry_sdk import capture_exception -def jira_project_issue_summary(email, api_token, project_name, hostname): +def jira_project_issue_summary(email, api_token, project_key, hostname): try: auth = HTTPBasicAuth(email, api_token) headers = {"Accept": "application/json"} - issue_url = f"https://{hostname}/rest/api/3/search?jql=project={project_name} AND issuetype=Story" + issue_url = f"https://{hostname}/rest/api/3/search?jql=project={project_key} AND issuetype=Story" issue_response = requests.request( "GET", issue_url, headers=headers, auth=auth ).json()["total"] - module_url = f"https://{hostname}/rest/api/3/search?jql=project={project_name} AND issuetype=Epic" + module_url = f"https://{hostname}/rest/api/3/search?jql=project={project_key} AND issuetype=Epic" module_response = requests.request( "GET", module_url, headers=headers, auth=auth ).json()["total"] - status_url = f"https://{hostname}/rest/api/3/status/?jql=project={project_name}" + status_url = f"https://{hostname}/rest/api/3/status/?jql=project={project_key}" status_response = requests.request( "GET", status_url, headers=headers, auth=auth ).json() - labels_url = f"https://{hostname}/rest/api/3/label/?jql=project={project_name}" + labels_url = f"https://{hostname}/rest/api/3/label/?jql=project={project_key}" labels_response = requests.request( "GET", labels_url, headers=headers, auth=auth ).json()["total"] users_url = ( - f"https://{hostname}/rest/api/3/users/search?jql=project={project_name}" + f"https://{hostname}/rest/api/3/users/search?jql=project={project_key}" ) users_response = requests.request( "GET", users_url, headers=headers, auth=auth