Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Goal

This section shows instructions for creating a Jira project with REST using a Gaia template.

Pre-requisites

This tutorial was written considering that :

  • you have a Jira instance installed and running on your server.
  • you have administrator rights on that Jira instance.
  • you have Gaia for Jira correctly installed (see Installing Gaia).
  • you have an Application Link with a Confluence instance.


URI Structure


To use a REST API, your application will make an HTTP request and parse the response. The Gaia REST API uses JSON as its communication format, and the standard HTTP methods like GETPUTPOST and DELETE (see API descriptions below for which methods are available). URIs for Gaia REST API resource have the following structure:


Code Block
themeConfluence
http://${JIRA BASE URL}/plugins/servlet/gaia/rest/project

Get all Gaia templates

Request method : GET

Return all configured Gaia templates.

Responses

STATUS 200 - application/json

Returns a list of Gaia templates.


Code Block
titleExample
[\n
  {\n
    "isDistributedPackage": false,\n
    "agileBoard": "",\n
    "components": "",\n
    "issueTypeSchemeName": "",\n
    "projectCategories": "",\n
    "projectType": "",\n
    "workflowSchemeName": "",\n
    "issueTypeScheme": "10000",\n
    "issueSecurityScheme": "-1",\n
    "issueTypeScreenSchemeName": "",\n
    "permissionSchemeName": "",\n
    "projectDefaultAssignee": "",\n
    "fieldConfigurationSchemeName": "",\n
    "issueSecuritySchemeName": "",\n
    "fieldConfigurationScheme": "-1",\n
    "confluenceSpaceDescription": "",\n
    "dashboard": "Checklistdashboard",\n
    "jiraFile": "checklist-jira-1307134068.xml",\n
    "notificationScheme": "10000",\n
    "confluenceFile": "",\n
    "lastModifiedDate": "null",\n
    "createFilters": false,\n
    "version": "",\n
    "workflowScheme": "10000",\n
    "notificationSchemeName": "",\n
    "isDefault": true,\n
    "templateName": "Checklist for Product Owner",\n
    "importComments": false,\n
    "versions": "",\n
    "templateDescription": "An example checklist for product owners made by Lare Lekman and revised in November 2013. productownerchecklist.org",\n
    "isEnabled": true,\n
    "projectDescription": "An example checklist for product owners made by Lare Lekman and revised in November 2013. productownerchecklist.org",\n
    "issueTypeScreenScheme": "1",\n
    "permissionScheme": "0"\n
  },\n
  {\n
    "isDistributedPackage": false,\n
    "agileBoard": "",\n
    "components": "",\n
    "issueTypeSchemeName": "",\n
    "projectCategories": "",\n
    "projectType": "",\n
    "workflowSchemeName": "",\n
    "issueTypeScheme": "10000",\n
    "issueSecurityScheme": "-1",\n
    "issueTypeScreenSchemeName": "",\n
    "permissionSchemeName": "",\n
    "projectDefaultAssignee": "",\n
    "fieldConfigurationSchemeName": "",\n
    "issueSecuritySchemeName": "",\n
    "fieldConfigurationScheme": "-1",\n
    "confluenceSpaceDescription": "",\n
    "dashboard": "Softwaredevelopmentdashboard",\n
    "jiraFile": "starter-jira-352114808.xml",\n
    "notificationScheme": "10000",\n
    "confluenceFile": "starter-confluence-352114808.zip",\n
    "lastModifiedDate": "null",\n
    "createFilters": false,\n
    "version": "",\n
    "workflowScheme": "10000",\n
    "notificationSchemeName": "",\n
    "isDefault": true,\n
    "templateName": "Starter process",\n
    "importComments": false,\n
    "versions": "",\n
    "templateDescription": "A simplified, but complete, software/system lifecycle process that covers project management and technical development activities. To use this template, you need to have a running instance of Confluence AND an application link connecting Jira with that Confluence instance.",\n
    "isEnabled": true,\n
    "projectDescription": "",\n
    "issueTypeScreenScheme": "1",\n
    "permissionScheme": "0"\n
  }\n
]


Create a project

Request method : POST 

Create a new project with the assosiated issues and configuration from a Gaia template.

The project type is required only if it is not already configured in the Gaia template.

The Confluence link in required only if there is a confluence file in the Gaia template.

If you specify a Confluence link, you will also need to send the Confluence credentials (username and password).

Code Block
titleExample
 {\n
    "templateName": "Starter process",\n
    "newProjectName":"A new project",\n
    "newProjectKey":"ANP",\n
    "projectLead":"JohnS",\n
    "confluenceLink":"Confluence",\n
    "username":"admin",\n
    "password":"admin",\n
    "projectType":"software"\n
}


Code Block
titleSchema
{\n
    "templateName": {\n
        "type": "string",\n
        "required":true\n
    },\n
    "newProjectName": {\n
        "type": "string",\n
        "required":true\n
    },\n
    "newProjectKey": {\n
        "type": "string",\n
        "required":true\n
    },\n
    "projectLead": {\n
        "type": "string",\n
        "required":true\n
    },\n
\t"confluenceLink": {\n
        "type": "string",\n
        "required":false\n
    },\n
    "username": {\n
        "type": "string",\n
        "required":false\n
    },\n
    "password": {\n
        "type": "string",\n
        "required":false\n
    },\n
    "projectType": {\n
        "type": "string",\n
        "required":false\n
    },\n
\t"copySchemes": {
\n\t\t"type": "boolean",\n
\t\t"required",false
\n\t},\n
\t"createProjectLink": {
\n\t\t"type": "boolean",\n
\t\t"required",false\n
\t}\n
}


Responses

STATUS 200 - application/json

Returns the ID and key of the created project. If there is an problem when creating the project or importing the issues, all errors will be in the Jira log file.

Code Block
titleExample
{\n
  "id": 10000,\n
  "key": "ANP"\n
}


STATUS 400 - application/json

Returned if the input is invalid (e.g. missing required fields, invalid field values, and so forth).

Code Block
titleExample
{\n
  "errors": {\n
    "password": "The password is required.",\n
    "templateName": "'badTemplate' is not a valid template name.",\n
    "username": "The username is required."\n
  }\n
}






Page Properties


Knowledge level

Status
colourRed
titleHIGH

Access level required
Status
colourRed
titleAdministrator



Table of contents

Table of Contents
maxLevel3