Skip to content

Commit

Permalink
Merge pull request #18 from Ctri-The-Third/fd-replies-and-trello-posi…
Browse files Browse the repository at this point in the history
…tion

Fd replies and trello position
  • Loading branch information
Ctri-The-Third authored Oct 27, 2022
2 parents fb01241 + dc186cf commit 25fa402
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion serviceHelpers/freshdesk.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,25 @@ def reply_to_ticket(self, ticket_id, agent_id, reply_txt):
self._request_and_validate(url, headers=None, body=data, method="post")

def update_ticket(
self, ticket_id, responder_id=None, status=None, ticket_type=None
self, ticket_id, responder_id:int=None, responder_group:int=None, status=None, ticket_type=None, **kwargs
):
"updates a ticket with new values for its fields"
url = f"https://{self.host}/api/v2/tickets/{ticket_id}"
data = {}
if responder_id is not None:
data["responder_id"] = responder_id

if responder_group is not None:
data["group_id"] = responder_group
if status is not None:
data["status"] = status
if ticket_type is not None:
data["type"] = ticket_type

if len(kwargs.items()) > 0 :
data["custom_fields"] = {}
for key,item in kwargs.items():
data["custom_fields"][key] = item
data = json.dumps(data)
self._request_and_validate(url, body=data, method="put")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="hex-helpers",
version="2.7.2",
version="2.7.4",
description="A series of light helpers for `freshdesk`,`gmail`,`habitica`,`hue lights`,`jira`,`slack`,`trello`",
long_description=README,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 25fa402

Please sign in to comment.