From c141140803187dc14b45b09ea36461e549db6db3 Mon Sep 17 00:00:00 2001 From: Matthis <99146727+matthisholleville@users.noreply.github.com> Date: Fri, 12 May 2023 12:25:38 +0200 Subject: [PATCH] feat: Add flag_issue method (#1163) Added the `flag_issue` method to provide functionality for flagging and un-flagging one or multiple issues in Jira. This method enhances the versatility of the codebase and allows for better issue management. Signed-off-by: Matthis Holleville --- atlassian/jira.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/atlassian/jira.py b/atlassian/jira.py index 83af2c4cc..b368a9dab 100644 --- a/atlassian/jira.py +++ b/atlassian/jira.py @@ -4577,6 +4577,23 @@ def dvcs_update_linked_repo_with_remote(self, repository_id): url = "rest/bitbucket/1.0/repositories/{}/sync".format(repository_id) return self.post(url) + def flag_issue(self, issueKeys, flag=True): + """ + Flags or un-flags one or multiple issues in Jira with a flag indicator. + :param issueKeys: List of issue keys to flag or un-flag. + :type issueKeys: list[str] + :param flag: Flag indicating whether to flag or un-flag the issues (default is True for flagging). + :type flag: bool + :return: POST request response. + :rtype: dict + """ + url = "rest/greenhopper/1.0/xboard/issue/flag/flag.json" + data = { + "issueKeys": issueKeys, + "flag": flag + } + return self.post(url, data) + def health_check(self): """ Get health status