Conditions | 3 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from .base import Resource |
||
12 | def create(self, |
||
13 | ticket_id: str, |
||
14 | content: str, |
||
15 | attachment_ids: list = None, |
||
16 | content_as_html: bool = False): |
||
17 | comment = { |
||
18 | "content": { |
||
19 | "html" if content_as_html else "text": content, |
||
20 | } |
||
21 | } |
||
22 | |||
23 | if attachment_ids is not None: |
||
24 | comment["attachment_ids"] = ",".join(attachment_ids) |
||
25 | |||
26 | self._post("/tickets/{ticket_id}/comments".format(ticket_id=ticket_id), data={"comment": comment}) |
||
27 |