Skip to content

Commit 0f0ada2

Browse files
author
Gonchik Tsymzhitov
committed
Jira: a few new methods
1 parent 13b36e1 commit 0f0ada2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

atlassian/jira.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ def rename_sprint(self, sprint_id, name, start_date, end_date):
18781878
'startDate': start_date,
18791879
'endDate': end_date})
18801880

1881-
def delete_spint(self, sprint_id):
1881+
def delete_sprint(self, sprint_id):
18821882
"""
18831883
Deletes a sprint.
18841884
Once a sprint is deleted, all issues in the sprint will be moved to the backlog.
@@ -1888,6 +1888,25 @@ def delete_spint(self, sprint_id):
18881888
"""
18891889
return self.delete('rest/agile/1.0/sprint/{sprintId}'.format(sprintId=sprint_id))
18901890

1891+
def update_partially_sprint(self, sprint_id, data):
1892+
"""
1893+
Performs a partial update of a sprint.
1894+
A partial update means that fields not present in the request JSON will not be updated.
1895+
Notes:
1896+
1897+
Sprints that are in a closed state cannot be updated.
1898+
A sprint can be started by updating the state to 'active'.
1899+
This requires the sprint to be in the 'future' state and have a startDate and endDate set.
1900+
A sprint can be completed by updating the state to 'closed'.
1901+
This action requires the sprint to be in the 'active' state. This sets the completeDate to the time of the request.
1902+
Other changes to state are not allowed.
1903+
The completeDate field cannot be updated manually.
1904+
:param sprint_id:
1905+
:param data: { "name": "new name"}
1906+
:return:
1907+
"""
1908+
return self.post('rest/agile/1.0/sprint/{}'.format(sprint_id), data=data)
1909+
18911910
def get_sprint_issues(self, sprint_id, start, limit):
18921911
"""
18931912
Returns all issues in a sprint, for a given sprint Id.

atlassian/rest_client.py

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class AtlassianRestAPI(object):
1717
form_token_headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
1818
'X-Atlassian-Token': 'no-check'}
1919

20+
response = None
21+
2022
def __init__(self, url, username=None, password=None, timeout=60, api_root='rest/api', api_version='latest',
2123
verify_ssl=True, session=None, oauth=None, cookies=None, advanced_mode=None):
2224

@@ -124,6 +126,7 @@ def request(self, method='GET', path='/', data=None, flags=None, params=None, he
124126
files=files
125127
)
126128
if self.advanced_mode:
129+
self.response = response
127130
return response
128131
try:
129132
if response.text:

0 commit comments

Comments
 (0)