Skip to content

Commit

Permalink
Merge pull request #247 from willicab/zammad-get-articles
Browse files Browse the repository at this point in the history
Create method for get articles by task id
  • Loading branch information
phenobarbital authored Apr 5, 2024
2 parents 7b9be2f + fadd98f commit 00ddd8b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions navigator/actions/zammad.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,23 @@ async def get_ticket(self, ticket_id: dict = None):
raise ConfigError(
f"Error Getting Zammad Ticket: {e}"
) from e

async def get_articles(self, ticket_id: int):
"""get_articles
get all articles of a ticket
Args:
ticket_id (int): id of ticket
"""
self.url = f"{self.zammad_instance}/api/v1/ticket_articles/by_ticket/{ticket_id}"
self.method = 'get'
try:
result, _ = await self.request(
self.url, self.method
)
return result
except Exception as e:
raise ConfigError(
f"Error Getting Zammad Ticket: {e}"
) from e
2 changes: 1 addition & 1 deletion navigator/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__description__ = (
"Navigator Web Framework based on aiohttp, " "with batteries included."
)
__version__ = "2.8.39"
__version__ = "2.8.40"
__author__ = "Jesus Lara"
__author_email__ = "jesuslarag@gmail.com"
__license__ = "BSD"

0 comments on commit 00ddd8b

Please sign in to comment.