@@ -129,6 +129,43 @@ def get_project_components(self, key):
129
129
"""
130
130
return self .get ('rest/api/2/project/{0}/components' .format (key ))
131
131
132
+ def get_project_versions (self , key , expand = None ):
133
+ """
134
+ Contains a full representation of a the specified project's versions.
135
+ :param key:
136
+ :param expand: the parameters to expand
137
+ :return:
138
+ """
139
+ if expand is not None :
140
+ params ["expand" ] = expand
141
+ return self .get ('rest/api/2/project/{}/versions' .format (key ))
142
+
143
+ def get_project_versions_paginated (self , key , start = None , limit = None , order_by = None , expand = None ):
144
+ """
145
+ Returns all versions for the specified project. Results are paginated.
146
+ Results can be ordered by the following fields:
147
+ sequence
148
+ name
149
+ startDate
150
+ releaseDate
151
+ :param key: the project key or id
152
+ :param start: the page offset, if not specified then defaults to 0
153
+ :param limit: how many results on the page should be included. Defaults to 50.
154
+ :param order_by: ordering of the results.
155
+ :param expand: the parameters to expand
156
+ :return:
157
+ """
158
+ params = {}
159
+ if start is not None :
160
+ params ["startAt" ] = int (start )
161
+ if limit is not None :
162
+ params ["maxResults" ] = int (limit )
163
+ if order_by is not None :
164
+ params ["orderBy" ] = order_by
165
+ if expand is not None :
166
+ params ["expand" ] = expand
167
+ return self .get ('rest/api/2/project/{}/version' .format (key ), params )
168
+
132
169
def issue (self , key , fields = '*all' ):
133
170
return self .get ('rest/api/2/issue/{0}?fields={1}' .format (key , fields ))
134
171
0 commit comments