Snippets

Adaptavist Create A Jira Project From The Script Console. Jira Cloud

Updated by Kristian Walker

File CreateAJiraProjectFromTheScriptConsoleJiraCloud.groovy Modified

  • Ignore whitespace
  • Hide word diff
         "key": "<ProjectKeyHere>", // Specify here the project key 
         "name": "<ProjectNameHere>", // Specify here the project name 
         "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type. using either: software, service_desk, business
-        // A list of all the project templace keys can be found in the page at:https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-get
+        // A list of all the project templace keys can be found in the page at:https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-post
         "projectTemplateKey": "<ProjectTemplateKeyhere>", // Specify here the project template key. An example of a valid key is: com.pyxis.greenhopper.jira:gh-simplified-agility-scrum
         "description": "<ProjectDescriptionHere>", // Specify here the project description
         "leadAccountId": "<ProjectLeadHere>", // Specify here the project lead user. You must specify a users account ID here
Updated by Kristian Walker

File CreateAJiraProjectFromTheScriptConsoleJiraCloud.groovy Modified

  • Ignore whitespace
  • Hide word diff
         "name": "<ProjectNameHere>", // Specify here the project name 
         "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type. using either: software, service_desk, business
         // A list of all the project templace keys can be found in the page at:https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-get
-        "projectTemplateKey": "<ProjectTemplateKeyhere>", // Specify here the project template key. 
+        "projectTemplateKey": "<ProjectTemplateKeyhere>", // Specify here the project template key. An example of a valid key is: com.pyxis.greenhopper.jira:gh-simplified-agility-scrum
         "description": "<ProjectDescriptionHere>", // Specify here the project description
         "leadAccountId": "<ProjectLeadHere>", // Specify here the project lead user. You must specify a users account ID here
         "url": "<ProjctURLHere>", // Specify here the project url
Updated by Kristian Walker

File CreateAJiraProjectFromTheScriptConsoleJiraCloud.groovy Modified

  • Ignore whitespace
  • Hide word diff
         "key": "<ProjectKeyHere>", // Specify here the project key 
         "name": "<ProjectNameHere>", // Specify here the project name 
         "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type. using either: software, service_desk, business
-        "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-project-management", // Specify here the project template key
+        // A list of all the project templace keys can be found in the page at:https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-project-get
+        "projectTemplateKey": "<ProjectTemplateKeyhere>", // Specify here the project template key. 
         "description": "<ProjectDescriptionHere>", // Specify here the project description
         "leadAccountId": "<ProjectLeadHere>", // Specify here the project lead user. You must specify a users account ID here
         "url": "<ProjctURLHere>", // Specify here the project url
Updated by Kristian Walker

File CreateAJiraProjectFromTheScriptConsoleJiraCloud.groovy Modified

  • Ignore whitespace
  • Hide word diff
 * amended and must be included in any circumstances where the code snippet is shared by You or a third party." 
 */
 
-def result = post("/rest/api/2/project")
+def result = post("/rest/api/3/project")
     .header('Content-Type', 'application/json')
     .body([
         "key": "<ProjectKeyHere>", // Specify here the project key 
         "name": "<ProjectNameHere>", // Specify here the project name 
-        "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type
+        "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type. using either: software, service_desk, business
         "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-project-management", // Specify here the project template key
         "description": "<ProjectDescriptionHere>", // Specify here the project description
-        "lead": "<ProjectLeadHere>", // Specify here the project lead user
+        "leadAccountId": "<ProjectLeadHere>", // Specify here the project lead user. You must specify a users account ID here
         "url": "<ProjctURLHere>", // Specify here the project url
         "assigneeType": "PROJECT_LEAD", // Specify here the default assignee value
         "avatarId": 10200, // Specify here the ID of the project avatar to use
Updated by Kristian Walker

File CreateAJiraProjectFromTheScriptConsole.groovy Deleted

  • Ignore whitespace
  • Hide word diff
-/*
-* This example script  console script shows how you can create a new Jira Project from a script.
-* "All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner
-* license shall be granted a  non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed or
-* amended and must be included in any circumstances where the code snippet is shared by You or a third party." 
-*/
-
-def result = post("/rest/api/2/project")
-    .header('Content-Type', 'application/json')
-    .body([
-        "key": "<ProjectKeyHere>", // Specify here the project key 
-        "name": "<ProjectNameHere>", // Specify here the project name 
-        "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type
-        "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-project-management", // Specify here the project template key
-        "description": "<ProjectDescriptionHere>", // Specify here the project description
-        "lead": "<ProjectLeadHere>", // Specify here the project lead user
-        "url": "<ProjctURLHere>", // Specify here the project url
-        "assigneeType": "PROJECT_LEAD", // Specify here the default assignee value
-        "avatarId": 10200, // Specify here the ID of the project avatar to use
-        //"issueSecurityScheme": 10001, // Uncomment and specify here the ID of the issue security scheme to use if you require one
-        "permissionScheme": 10001, // Specify here the ID of the permission scheme to use
-        "notificationScheme": 10000, // Specify here the ID of the notification scheme to use
-        // "categoryId": 10120  // Uncomment and specify the ID for the proiect category if required.
-    ])
-    .asString()

File CreateAJiraProjectFromTheScriptConsoleJiraCloud.groovy Added

  • Ignore whitespace
  • Hide word diff
+/*
+* This example script  console script shows how you can create a new Jira Project from a script.
+* "All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner
+* license shall be granted a  non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed or
+* amended and must be included in any circumstances where the code snippet is shared by You or a third party." 
+*/
+
+def result = post("/rest/api/2/project")
+    .header('Content-Type', 'application/json')
+    .body([
+        "key": "<ProjectKeyHere>", // Specify here the project key 
+        "name": "<ProjectNameHere>", // Specify here the project name 
+        "projectTypeKey": "<ProjectTypeKeyHere>", // Specify here the project type
+        "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-project-management", // Specify here the project template key
+        "description": "<ProjectDescriptionHere>", // Specify here the project description
+        "lead": "<ProjectLeadHere>", // Specify here the project lead user
+        "url": "<ProjctURLHere>", // Specify here the project url
+        "assigneeType": "PROJECT_LEAD", // Specify here the default assignee value
+        "avatarId": 10200, // Specify here the ID of the project avatar to use
+        //"issueSecurityScheme": 10001, // Uncomment and specify here the ID of the issue security scheme to use if you require one
+        "permissionScheme": 10001, // Specify here the ID of the permission scheme to use
+        "notificationScheme": 10000, // Specify here the ID of the notification scheme to use
+        // "categoryId": 10120  // Uncomment and specify the ID for the proiect category if required.
+    ])
+    .asString()
  1. 1
  2. 2
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.