diff --git a/freshdesk.py b/freshdesk.py index f69104f..29abe57 100644 --- a/freshdesk.py +++ b/freshdesk.py @@ -151,10 +151,6 @@ def get_worklogs(self,ticketID): url = 'https://%s/api/v2/tickets/%s/time_entries' % (self.host,ticketID) -<<<<<<< HEAD -======= - ->>>>>>> 9251d5b9adf5e5c462589e7ef30ed9343ab8f572 AuthString = "Basic %s" % (self.api_key) r = requests.get ( url, diff --git a/habitica.py b/habitica.py index c5523a1..8cf102e 100644 --- a/habitica.py +++ b/habitica.py @@ -1,5 +1,6 @@ import logging import json +from typing import List import requests lo = logging.getLogger("HabiticaMapper") @@ -9,7 +10,7 @@ def __init__(self,user_id,api_key) -> None: self.user_id = user_id self.api_key = api_key - def fetchHabiticaDailies(self,dateAsString): + def fetchHabiticaDailies(self,dateAsString) -> list: url = "https://habitica.com/api/v3/tasks/user?type=dailys&dueDate=%s" % (dateAsString) headers = self._getHabiticaHeaders() diff --git a/jira.py b/jira.py index 66c9883..6bc3dd4 100644 --- a/jira.py +++ b/jira.py @@ -57,6 +57,7 @@ def from_dict(self,new_dict:dict): self.key = new_dict["key"] if "key" in new_dict else self.key self.summary = fields["summary"] if "summary" in fields else self.summary self.description = fields["description"] if "description" in fields else self.description + self.assignee_id = assignee_dict["key"] if "key" in assignee_dict else self.assignee_id self.assignee_id = assignee_dict["accountId"] if "accountId" in assignee_dict else self.assignee_id self.assignee_name = assignee_dict["displayName"] if "displayName" in assignee_dict else self.assignee_name self.priority = priority_dict["name"] if "name" in priority_dict else self.priority diff --git a/trello.py b/trello.py index 11cfbc2..91d32d2 100644 --- a/trello.py +++ b/trello.py @@ -6,6 +6,8 @@ import json import urllib +from soupsieve import match + lo = logging.getLogger("TrelloHelper") @@ -32,7 +34,21 @@ def find_trello_cards(self,regex): if re.search(regex,card["name"]) or re.search(regex,card["desc"]): foundCards.append(card) return foundCards - + + def search_trello_cards(self,search_criteria,board_id = None) -> list: + "uses the trello search criteria, can return archived cards" + url = "https://api.trello.com/1/search" + params = self._get_trello_params() + params['card_fields'] = 'desc, name' + params['modelTypes'] = 'cards' + if board_id: + params["idBoards"] = board_id + params["query"] = search_criteria + r = requests.get(url, params = params) + matching_summaries = json.loads(r.content)["cards"] + return matching_summaries + + def purge_trello_cards(self,titlePattern = "", descPattern = "", targetLists = [] , customFieldIDs = []): """