@@ -4232,6 +4232,7 @@ def tempo_teams_get_memberships_for_member(self, username):
4232
4232
# Agile (Formerly Greenhopper) REST API implements
4233
4233
# Resource: https://docs.atlassian.com/jira-software/REST/7.3.1/
4234
4234
#######################################################################
4235
+ # /rest/agile/1.0/backlog/issue
4235
4236
def move_issues_to_backlog (self , issue_keys ):
4236
4237
"""
4237
4238
Move issues to backlog
@@ -4255,6 +4256,29 @@ def add_issues_to_backlog(self, issues):
4255
4256
data = dict (issues = issues )
4256
4257
return self .post (url , data = data )
4257
4258
4259
+ def get_agile_board_by_filter_id (self , filter_id ):
4260
+ """
4261
+ Gets an agile board by the filter id
4262
+ :param filter_id: int, str
4263
+ """
4264
+ url = "rest/agile/1.0/board/filter/{filter_id}" .format (filter_id = filter_id )
4265
+ return self .get (url )
4266
+
4267
+ # /rest/agile/1.0/board
4268
+ def create_agile_board (self , name , type , filter_id , location = None ):
4269
+ """
4270
+ Create an agile board
4271
+ :param name: str: Must be less than 255 characters.
4272
+ :param type: str: "scrum" or "kanban"
4273
+ :param filter_id: int
4274
+ :param location: dict, Optional. Only specify this for Jira Cloud!
4275
+ """
4276
+ data = {"name" : name , "type" : type , "filterId" : filter_id }
4277
+ if location :
4278
+ data ["location" ] = location
4279
+ url = "rest/agile/1.0/board"
4280
+ return self .post (url , data = data )
4281
+
4258
4282
def get_all_agile_boards (
4259
4283
self ,
4260
4284
board_name = None ,
@@ -4287,44 +4311,35 @@ def get_all_agile_boards(
4287
4311
4288
4312
return self .get (url , params = params )
4289
4313
4290
- def get_agile_board (self , board_id ):
4314
+ def delete_agile_board (self , board_id ):
4291
4315
"""
4292
- Get agile board info by id
4316
+ Delete agile board by id
4293
4317
:param board_id:
4294
4318
:return:
4295
4319
"""
4296
4320
url = "rest/agile/1.0/board/{}" .format (str (board_id ))
4297
- return self .get (url )
4298
-
4299
- def create_agile_board (self , name , type , filter_id , location = None ):
4300
- """
4301
- Create an agile board
4302
- :param name: str: Must be less than 255 characters.
4303
- :param type: str: "scrum" or "kanban"
4304
- :param filter_id: int
4305
- :param location: dict, Optional. Only specify this for Jira Cloud!
4306
- """
4307
- data = {"name" : name , "type" : type , "filterId" : filter_id }
4308
- if location :
4309
- data ["location" ] = location
4310
- url = "rest/agile/1.0/board"
4311
- return self .post (url , data = data )
4321
+ return self .delete (url )
4312
4322
4313
- def delete_agile_board (self , board_id ):
4323
+ def get_agile_board (self , board_id ):
4314
4324
"""
4315
- Delete agile board by id
4325
+ Get agile board info by id
4316
4326
:param board_id:
4317
4327
:return:
4318
4328
"""
4319
4329
url = "rest/agile/1.0/board/{}" .format (str (board_id ))
4320
- return self .delete (url )
4330
+ return self .get (url )
4321
4331
4322
- def get_agile_board_by_filter_id (self , filter_id ):
4332
+ def get_issues_for_backlog (self , board_id ):
4323
4333
"""
4324
- Gets an agile board by the filter id
4325
- :param filter_id: int, str
4334
+ Returns all issues from the board's backlog, for the given board ID.
4335
+ This only includes issues that the user has permission to view.
4336
+ The backlog contains incomplete issues that are not assigned to any future or active sprint.
4337
+ Note, if the user does not have permission to view the board, no issues will be returned at all.
4338
+ Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic.
4339
+ By default, the returned issues are ordered by rank.
4340
+ :param board_id: int, str
4326
4341
"""
4327
- url = "rest/agile/1.0/board/filter/{filter_id} " .format (filter_id = filter_id )
4342
+ url = "rest/agile/1.0/board/{board_id}/backlog " .format (board_id = board_id )
4328
4343
return self .get (url )
4329
4344
4330
4345
def get_agile_board_configuration (self , board_id ):
@@ -4354,13 +4369,6 @@ def get_agile_board_configuration(self, board_id):
4354
4369
url = "rest/agile/1.0/board/{}/configuration" .format (str (board_id ))
4355
4370
return self .get (url )
4356
4371
4357
- def get_issues_for_backlog (self , board_id ):
4358
- """
4359
- :param board_id: int, str
4360
- """
4361
- url = "rest/agile/1.0/board/{board_id}/backlog" .format (board_id = board_id )
4362
- return self .get (url )
4363
-
4364
4372
def get_issues_for_board (self , board_id , jql , fields = "*all" , start = 0 , limit = None , expand = None ):
4365
4373
"""
4366
4374
Returns all issues from a board, for a given board Id.
@@ -4394,15 +4402,6 @@ def get_issues_for_board(self, board_id, jql, fields="*all", start=0, limit=None
4394
4402
url = "rest/agile/1.0/board/{board_id}/issue" .format (board_id = board_id )
4395
4403
return self .get (url , params = params )
4396
4404
4397
- def get_agile_board_properties (self , board_id ):
4398
- """
4399
- Returns the keys of all properties for the board identified by the id.
4400
- The user who retrieves the property keys is required to have permissions to view the board.
4401
- :param board_id: int, str
4402
- """
4403
- url = "rest/agile/1.0/board/{board_id}/properties" .format (board_id = board_id )
4404
- return self .get (url )
4405
-
4406
4405
# /rest/agile/1.0/board/{boardId}/epic
4407
4406
def get_epics (
4408
4407
self ,
@@ -4526,6 +4525,105 @@ def get_issues_without_epic(
4526
4525
params ["maxResults" ] = limit
4527
4526
return self .get (url , params = params )
4528
4527
4528
+ # rest/agile/1.0/board/{boardId}/project
4529
+ def get_all_projects_associated_with_board (self , board_id , start = 0 , limit = 50 ):
4530
+ """
4531
+ Returns all projects that are associated with the board,
4532
+ for the given board ID. A project is associated with a board only
4533
+ if the board filter explicitly filters issues by the project and guaranties that
4534
+ all issues will come for one of those projects e.g. board's filter with
4535
+ "project in (PR-1, PR-1) OR reporter = admin" jql Projects are returned only
4536
+ if user can browse all projects that are associated with the board.
4537
+ Note, if the user does not have permission to view the board,
4538
+ no projects will be returned at all. Returned projects are ordered by the name.
4539
+ :param board_id:
4540
+ :param start: The starting index of the returned projects.
4541
+ Base index: 0.
4542
+ See the 'Pagination' section at the top of this page for more details.
4543
+ :param limit: The maximum number of projects to return per page.
4544
+ Default: 50.
4545
+ See the 'Pagination' section at the top of this page for more details
4546
+ :return:
4547
+ """
4548
+ url = "/rest/agile/1.0/board/{boardId}/project" .format (boardId = board_id )
4549
+ params = {}
4550
+ if start :
4551
+ params ["startAt" ] = start
4552
+ if limit :
4553
+ params ["maxResults" ] = limit
4554
+ return self .get (url , params = params )
4555
+
4556
+ # /rest/agile/1.0/board/{boardId}/properties
4557
+ def get_agile_board_properties (self , board_id ):
4558
+ """
4559
+ Returns the keys of all properties for the board identified by the id.
4560
+ The user who retrieves the property keys is required to have permissions to view the board.
4561
+ :param board_id: int, str
4562
+ """
4563
+ url = "rest/agile/1.0/board/{boardId}/properties" .format (boardId = board_id )
4564
+ return self .get (url )
4565
+
4566
+ def set_agile_board_property (self , board_id , property_key ):
4567
+ """
4568
+ Sets the value of the specified board's property.
4569
+ You can use this resource to store a custom data
4570
+ against the board identified by the id.
4571
+ The user who stores the data is required to have permissions to modify the board.
4572
+ :param board_id:
4573
+ :param property_key:
4574
+ :return:
4575
+ """
4576
+ url = "/rest/agile/1.0/board/{boardId}/properties/{propertyKey}" .format (
4577
+ boardId = board_id , propertyKey = property_key
4578
+ )
4579
+ return self .put (url )
4580
+
4581
+ def get_agile_board_property (self , board_id , property_key ):
4582
+ """
4583
+ Returns the value of the property with a given key from the board identified by the provided id.
4584
+ The user who retrieves the property is required to have permissions to view the board.
4585
+ :param board_id:
4586
+ :param property_key:
4587
+ :return:
4588
+ """
4589
+ url = "/rest/agile/1.0/board/{boardId}/properties/{propertyKey}" .format (
4590
+ boardId = board_id , propertyKey = property_key
4591
+ )
4592
+ return self .get (url )
4593
+
4594
+ def delete_agile_board_property (self , board_id , property_key ):
4595
+ """
4596
+ Removes the property from the board identified by the id.
4597
+ Ths user removing the property is required to have permissions to modify the board.
4598
+ :param board_id:
4599
+ :param property_key:
4600
+ :return:
4601
+ """
4602
+ url = "/rest/agile/1.0/board/{boardId}/properties/{propertyKey}" .format (
4603
+ boardId = board_id , propertyKey = property_key
4604
+ )
4605
+ return self .delete (url )
4606
+
4607
+ # /rest/agile/1.0/board/{boardId}/settings
4608
+ def get_agile_board_refined_velocity (self , board_id ):
4609
+ """
4610
+ Returns the estimation statistic settings of the board.
4611
+ :param board_id:
4612
+ :return:
4613
+ """
4614
+ url = "/rest/agile/1.0/board/{boardId}/settings" .format (boardId = board_id )
4615
+ return self .get (url )
4616
+
4617
+ def set_agile_board_refined_velocity (self , board_id , data ):
4618
+ """
4619
+ Sets the estimation statistic settings of the board.
4620
+ :param board_id:
4621
+ :param data:
4622
+ :return:
4623
+ """
4624
+ url = "/rest/agile/1.0/board/{boardId}/settings" .format (boardId = board_id )
4625
+ return self .put (url , data = data )
4626
+
4529
4627
def create_sprint (self , name , board_id , start_date = None , end_date = None , goal = None ):
4530
4628
"""
4531
4629
Create a sprint within a board.
0 commit comments