@@ -1034,8 +1034,15 @@ def create_issue(self, fields, update_history=False):
10341034 """
10351035 Creates an issue or a sub-task from a JSON representation
10361036 :param fields: JSON data
1037+ mandatory keys are issuetype, summary and project
10371038 :param update_history: bool (if true then the user's project history is updated)
10381039 :return:
1040+ example:
1041+ fields = dict(summary='Into The Night',
1042+ project = dict(key='APA'),
1043+ issuetype = dict(name='Story')
1044+ )
1045+ jira.create_issue(fields=fields)
10391046 """
10401047 url = 'rest/api/2/issue'
10411048 data = {'fields' : fields }
@@ -2479,6 +2486,24 @@ def create_sprint(self, name, board_id, start_date=None, end_date=None, goal=Non
24792486 data ['goal' ] = goal
24802487 return self .post (url , data = data )
24812488
2489+ def add_issues_to_sprint (self , sprint_id , issues ):
2490+ """
2491+ Adding Issue(s) to Sprint
2492+ :param sprint_id: int/str: The ID for the Sprint.
2493+ Sprint to be Active or Open only.
2494+ eg. 104
2495+ :param issues: list: List of Issue Keys
2496+ eg. ['APA-1', 'APA-2']
2497+ :return: Dictionary of response received from the API
2498+
2499+ https://docs.atlassian.com/jira-software/REST/8.9.0/#agile/1.0/sprint-moveIssuesToSprint
2500+ """
2501+ if not isinstance (issues , list ):
2502+ raise ValueError ("`issues` param should be List of Issue Keys" )
2503+ url = '/rest/agile/1.0/sprint/{sprint_id}/issue' .format (sprint_id = sprint_id )
2504+ data = dict (issues = issues )
2505+ return self .post (url , data = data )
2506+
24822507 def get_all_sprint (self , board_id , state = None , start = 0 , limit = 50 ):
24832508 """
24842509 Returns all sprints from a board, for a given board Id.
0 commit comments