From f71347b585999b3e9b8f8b902113688c73c33e02 Mon Sep 17 00:00:00 2001 From: taatomae Date: Fri, 8 Nov 2024 19:17:43 +0100 Subject: [PATCH 1/2] Feat support autoStartStop and incompleteIssuesDestinationId in sprint create and update Support autoStartStop and incompleteIssuesDestinationId in create_sprint and update_sprint. Documentation: https://developer.atlassian.com/server/jira/platform/rest/v10000/api-group-sprint/#api-agile-1-0-sprint-post --- jira/client.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/jira/client.py b/jira/client.py index 36dc2fea9..0d0a6a06a 100644 --- a/jira/client.py +++ b/jira/client.py @@ -5364,6 +5364,8 @@ def update_sprint( endDate: Any | None = None, state: str | None = None, goal: str | None = None, + autoStartStop: bool | None = None, + incompleteIssuesDestinationId: int | None = None, ) -> dict[str, Any]: """Updates the sprint with the given values. @@ -5374,11 +5376,13 @@ def update_sprint( endDate (Optional[Any]): The start date for the sprint state: (Optional[str]): The state of the sprint goal: (Optional[str]): The goal of the sprint + autoStartStop: (Optional[bool]): Start and complete sprint automatically + incompleteIssuesDestinationId: (Optional[int]): After sprint completes, move open issues to this sprint id, -1 for backlog Returns: Dict[str, Any] """ - payload = {} + payload : dict[str, Any] = {} if name: payload["name"] = name if startDate: @@ -5389,6 +5393,10 @@ def update_sprint( payload["state"] = state if goal: payload["goal"] = goal + if autoStartStop: + payload["autoStartStop"] = autoStartStop + if incompleteIssuesDestinationId: + payload["incompleteIssuesDestinationId"] = incompleteIssuesDestinationId url = self._get_url(f"sprint/{id}", base=self.AGILE_BASE_URL) r = self._session.put(url, data=json.dumps(payload)) @@ -5519,6 +5527,8 @@ def create_sprint( startDate: Any | None = None, endDate: Any | None = None, goal: str | None = None, + autoStartStop: bool | None = None, + incompleteIssuesDestinationId: int | None = None, ) -> Sprint: """Create a new sprint for the ``board_id``. @@ -5528,6 +5538,8 @@ def create_sprint( startDate (Optional[Any]): Start date for the sprint. endDate (Optional[Any]): End date for the sprint. goal (Optional[str]): Goal for the sprint. + autoStartStop: (Optional[bool]): Start and complete sprint automatically + incompleteIssuesDestinationId: (Optional[int]): After sprint completes, move open issues to this sprint id, -1 for backlog Returns: Sprint: The newly created Sprint @@ -5539,6 +5551,10 @@ def create_sprint( payload["endDate"] = endDate if goal: payload["goal"] = goal + if autoStartStop: + payload["autoStartStop"] = autoStartStop + if incompleteIssuesDestinationId: + payload["incompleteIssuesDestinationId"] = incompleteIssuesDestinationId raw_sprint_json: dict[str, Any] url = self._get_url("sprint", base=self.AGILE_BASE_URL) From caaec24b93f039a5df714e7b367a91b8f1782255 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 18:21:17 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jira/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jira/client.py b/jira/client.py index 0d0a6a06a..2fe5c0798 100644 --- a/jira/client.py +++ b/jira/client.py @@ -5382,7 +5382,7 @@ def update_sprint( Returns: Dict[str, Any] """ - payload : dict[str, Any] = {} + payload: dict[str, Any] = {} if name: payload["name"] = name if startDate: