Exemplo n.º 1
0
    def listTickets(self, projectId=-1):
        if projectId == -1:
            raise PluginError("Invalid project id")

        req = ACRequest("projects", item_id=projectId, subcommand="tickets", ac_url=self.url, api_key=self.token)

        makeTicket = lambda item: Ticket(
            id=item["id"], name=item["name"], ticket_id=item["ticket_id"], project_id=projectId
        )

        return [makeTicket(item) for item in req.execute()]
Exemplo n.º 2
0
    def postTimer(self, projectId=-1, ticketId=-1, data=None):
        if projectId == -1:
            raise PluginError("Invalid project id")

        if ticketId == -1:
            raise PluginError("Invalid ticket id")

        req = ACRequest(
            "projects", item_id=projectId, subcommand="time/add", data=data, ac_url=self.url, api_key=self.token
        )
        return req.execute()
Exemplo n.º 3
0
 def listProjects(self):
     req = ACRequest("projects", ac_url=self.url, api_key=self.token)
     makeProject = lambda item: Project(id=item["id"], name=item["name"])
     return [makeProject(item) for item in req.execute()]