From 63e36f64c0cce83c50a70dadeb46d8f40bc650bc Mon Sep 17 00:00:00 2001 From: Martin Date: Mar 23 2017 21:00:25 +0000 Subject: change_issue_state: add "close_status" option close_status option allows libpagure users to specifiy reason why issue has been closed --- diff --git a/libpagure/libpagure.py b/libpagure/libpagure.py index 111fc13..4c91d64 100644 --- a/libpagure/libpagure.py +++ b/libpagure/libpagure.py @@ -412,11 +412,13 @@ class Pagure(object): return return_value - def change_issue_status(self, issue_id, new_status): + def change_issue_status(self, issue_id, new_status, close_status=None): """ Change the status of an issue. :param issue_id: the id of the issue :param new_status: the new status fo the issue + :param close_status: optional param to add reason why issue + has been closed (like wontfix, fixed, duplicate, ...) :return: """ if self.username is None: @@ -428,6 +430,8 @@ class Pagure(object): issue_id) payload = {'status': new_status} + if close_status is not None: + payload['close_status'] = close_status return_value = self.__call_api(request_url, method='POST', data=payload)