@@ -970,17 +970,6 @@ def get_issue_transitions_full(self, issue_key, transition_id=None, expand=None)
970
970
params ['expand' ] = expand
971
971
return self .get (url , params = params )
972
972
973
- def get_server_info (self , do_health_check = False ):
974
- """
975
- Returns general information about the current Jira server.
976
- with health checks or not.
977
- """
978
- if do_health_check :
979
- check = True
980
- else :
981
- check = False
982
- return self .get ('rest/api/2/serverInfo' , params = {"doHealthCheck" : check })
983
-
984
973
#######################################################################################################
985
974
# User
986
975
# Reference: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.0/#api/2/user
@@ -1230,6 +1219,13 @@ def add_user_to_application(self, username, application_key):
1230
1219
}
1231
1220
return self .post ('rest/api/2/user/application' , params = params ) is None
1232
1221
1222
+ #######################################################################################################
1223
+ # Projects
1224
+ # Reference: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.0/#api/2/project
1225
+ #######################################################################################################
1226
+ def get_all_projects (self , included_archived = None ):
1227
+ return self .projects (included_archived )
1228
+
1233
1229
def projects (self , included_archived = None ):
1234
1230
"""Returns all projects which are visible for the currently logged in user.
1235
1231
If no user is logged in, it returns the list of projects that are visible when using anonymous access.
@@ -1241,11 +1237,28 @@ def projects(self, included_archived=None):
1241
1237
params ['includeArchived' ] = included_archived
1242
1238
return self .get ('rest/api/2/project' )
1243
1239
1244
- def get_all_projects (self , included_archived = None ):
1245
- return self .projects (included_archived )
1246
-
1247
- def project (self , key ):
1248
- return self .get ('rest/api/2/project/{0}' .format (key ))
1240
+ def create_project_from_raw_json (self , json ):
1241
+ """
1242
+ Creates a new project.
1243
+ {
1244
+ "key": "EX",
1245
+ "name": "Example",
1246
+ "projectTypeKey": "business",
1247
+ "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-project-management",
1248
+ "description": "Example Project description",
1249
+ "lead": "Charlie",
1250
+ "url": "http://atlassian.com",
1251
+ "assigneeType": "PROJECT_LEAD",
1252
+ "avatarId": 10200,
1253
+ "issueSecurityScheme": 10001,
1254
+ "permissionScheme": 10011,
1255
+ "notificationScheme": 10021,
1256
+ "categoryId": 10120
1257
+ }
1258
+ :param json:
1259
+ :return:
1260
+ """
1261
+ return self .post (json = json )
1249
1262
1250
1263
def delete_project (self , key ):
1251
1264
"""
@@ -1255,6 +1268,22 @@ def delete_project(self, key):
1255
1268
"""
1256
1269
return self .delete ('rest/api/2/project/{0}' .format (key ))
1257
1270
1271
+ def project (self , key , expand = None ):
1272
+ params = {}
1273
+ if expand :
1274
+ params ['expand' ] = expand
1275
+ return self .get ('rest/api/2/project/{0}' .format (key ), params = params )
1276
+
1277
+ def get_project (self , key , expand ):
1278
+ """
1279
+ Contains a full representation of a project in JSON format.
1280
+ All project keys associated with the project will only be returned if expand=projectKeys.
1281
+ :param key:
1282
+ :param expand:
1283
+ :return:
1284
+ """
1285
+ return self .project (key = key , expand = expand )
1286
+
1258
1287
def get_project_components (self , key ):
1259
1288
"""
1260
1289
Get project components using project key
@@ -2178,6 +2207,17 @@ def reindex_project(self, project_key):
2178
2207
def reindex_issue (self , list_of_ ):
2179
2208
pass
2180
2209
2210
+ def get_server_info (self , do_health_check = False ):
2211
+ """
2212
+ Returns general information about the current Jira server.
2213
+ with health checks or not.
2214
+ """
2215
+ if do_health_check :
2216
+ check = True
2217
+ else :
2218
+ check = False
2219
+ return self .get ('rest/api/2/serverInfo' , params = {"doHealthCheck" : check })
2220
+
2181
2221
#######################################################################
2182
2222
# Tempo Account REST API implements
2183
2223
#######################################################################
0 commit comments