#32 Update create_issue with the latest API
Merged 6 years ago by cverna. Opened 6 years ago by cverna.
cverna/libpagure create_issue_update  into  master

file modified
+17 -2
@@ -288,18 +288,33 @@ 

  

          LOG.debug(return_value)

  

-     def create_issue(self, title, content, private=None):

+     def create_issue(self, title, content, priority=None,

+                      milestone=None, tags=None, assignee=None,

+                      private=None):

          """

          Create a new issue.

          :param title: the title of the issue

          :param content: the description of the issue

+         :param priority: the priority of the ticket

+         :param milestone: the milestone of the ticket

+         :param tags: comma sperated list of tag for the ticket

+         :param assignee: the assignee of the ticket

          :param private: whether create this issue as private

          :return:

          """

          request_url = "{}new_issue".format(self.create_basic_url())

  

          payload = {'title': title, 'issue_content': content}

-         if private:

+ 

+         if priority is not None:

+             payload['priority'] = priority

+         if milestone is not None:

+             payload['milestone'] = milestone

+         if tags is not None:

+             payload['tag'] = tags

+         if assignee is not None:

+             payload['assignee'] = assignee

+         if private is not None:

              payload['private'] = private

  

          return_value = self._call_api(request_url,

almost feels like this should be named tags (plural) but the API uses tag so +1

rebased onto 7ff48b3

6 years ago

let have the library more friendly than the API and use tags since you can pass a list of tags

Pull-Request has been merged by cverna

6 years ago

can we get a new release of libpagure so we can use it ?

can we get a new release of libpagure so we can use it ?

I just got access to the PyPI project so I ll be doing a release soon

Metadata