Greetings all,
I'm trying to write a little application to automate a few things with Jira. I'm hoping to test the application by using the Atlassian SDK, but I'm running into a problem with the "create project" step. I'm hoping somebody can point me in the right direction for a solution.
My local development system is a macOS system. I used `brew tap atlassian/tap && brew install atlassian/tap/atlassian-plugin-sdk` to install the SDK. I am able to log in to the local instance of Jira through my web browser at `http://localhost:2990/jira/` and create a new project through the web UI. The output of `atlas-version` is shown below.
ATLAS Version: 8.2.7
ATLAS Home: /usr/local/Cellar/atlassian-plugin-sdk/8.2.7/libexec
ATLAS Scripts: /usr/local/Cellar/atlassian-plugin-sdk/8.2.7/libexec/bin
ATLAS Maven Home: /usr/local/Cellar/atlassian-plugin-sdk/8.2.7/libexec/apache-maven-3.5.4
AMPS Version: 8.1.2
--------
Executing: /usr/local/Cellar/atlassian-plugin-sdk/8.2.7/libexec/apache-maven-3.5.4/bin/mvn --version -gs /usr/local/Cellar/atlassian-plugin-sdk/8.2.7/libexec/apache-maven-3.5.4/conf/settings.xml
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T14:33:14-04:00)
Maven home: /usr/local/Cellar/atlassian-plugin-sdk/8.2.7/libexec/apache-maven-3.5.4
Java version: 11.0.11, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "11.4", arch: "x86_64", family: "mac"
I am trying to create a new project through the Python jira library. I'm seemingly able to authenticate against the server, and then I try to run the `create_project` command.
from jira import JIRA
jira = JIRA(
'http://localhost:2990/jira',
basic_auth=('admin', 'admin'),
logging=False,
validate=True,
max_retries=5
)
jira.create_project(
key='PRJ0',
name='Project 0'
)
and I get the following error.
"The project template specified does not exist. Make sure the project template is available in your Jira instance. Please talk to your Jira administrator if you need more help."
The URL being used by the Python library is http://localhost:2990/jira/rest/api/2/project, and the payload is the following.
{
"name": "Project 0",
"key": "PRJ0",
"projectTypeKey": "software",
"projectTemplateKey": "com.pyxis.greenhopper.jira:gh-simplified-basic",
"lead": "admin",
"assigneeType": "PROJECT_LEAD",
"description": "",
"permissionScheme": 0,
"notificationScheme": 10000,
"url": ""
}
Hi David,
I understand you are using the python module in the Jira Server/Data Center SDK in order to try to create a new project. However this is not working because the error message indicates that the project template does not exist. Looking at the value being supplied, it looks like you're trying to select a project template that is only valid in Jira Cloud : com.pyxis.greenhopper.jira:gh-simplified-basic
This is not a valid project template name though for Jira Server or Jira Data Center.
Unfortunately, the Jira Server REST API documentation doesn't explicitly document what these valid project template keys are for you to use like the Cloud version does. But I found that you can make a GET call to the endpoint of /rest/project-templates/1.0/templates and this endpoint can return to you all the project types that can be created in that Jira site. But since this a private endpoint, it's not easily called to find it. You could install the Atlassian REST API Browser and then use that within Jira itself to be able to call that endpoint. Specifically you can look for the parameter called projectTemplateModuleCompleteKey and the value there will be the templates you could specify to create a project via rest.
There have been a few other posts where users have sought after those projectTemplateKeys, such as in https://community.atlassian.com/t5/Answers-Developer-Questions/Re-JIRA-API-7-1-0-Create-Project/qaq-p/551446/comment-id/89101#M89101
In your case, I'm suspecting that you will need to use one of these three values to create a software type project:
I hope that helps.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.