From 3f5a8f4091c7b8fbf22ed7e99ff57c20f9ea1606 Mon Sep 17 00:00:00 2001 From: teteumac <43827568+teteumac@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:28:29 +0100 Subject: [PATCH] correction of Jira's PUT to POST method (#56) --- api/controller/jira_controller.py | 2 +- api/jira_api.py | 2 +- application/tickets/static/js/Jira.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/controller/jira_controller.py b/api/controller/jira_controller.py index 0684091..9175a07 100644 --- a/api/controller/jira_controller.py +++ b/api/controller/jira_controller.py @@ -43,7 +43,7 @@ def add_comment(self, text): connection.close() class Jira(): - def __init__(self, credentials_file, host='http://its.cern.ch/jira'): + def __init__(self, credentials_file, host='https://its.cern.ch/jira'): self.client = None self.logger = logging.getLogger() self.credentials_file = credentials_file diff --git a/api/jira_api.py b/api/jira_api.py index 71e0625..21e6905 100644 --- a/api/jira_api.py +++ b/api/jira_api.py @@ -16,7 +16,7 @@ def __init__(self): @APIBase.ensure_request_data @APIBase.exceptions_to_errors @APIBase.ensure_role('manager') - def put(self): + def post(self): """ Create a ticket with the provided JSON content """ diff --git a/application/tickets/static/js/Jira.js b/application/tickets/static/js/Jira.js index 21fffbf..5399a54 100644 --- a/application/tickets/static/js/Jira.js +++ b/application/tickets/static/js/Jira.js @@ -46,7 +46,7 @@ function jira_api(data) { $('body').addClass('loading'); fetch('api/jira/create', { - method: 'PUT', + method: 'POST', body: JSON.stringify(data), headers: {'Content-Type': 'application/json'} }