Skip to content

Feat support autoStartStop in sprint create and update #1921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand All @@ -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))
Expand Down Expand Up @@ -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``.

Expand All @@ -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
Expand All @@ -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)
Expand Down
Loading