Hello,
I've been searching on this forum and Google to find a way to create projects using Rest API. I'm not familiar with all of this and I don't find solutions really easy to understand.
Could someone explain how to do it :) ? I've generated credentials, even the base64 Basic auth for the request.
Thank you ! a
@Administrateur HawaiiFirst of all, welcome to the community!
Service Desk project are special kind of Jira Projects, so you can create Service Desk project using Jira's REST API by passing appropriate options, which all are explained in below API documentation link.
Please take a look at this - https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-project-post
ok I followed instructions but when trying with curl I get
curl --request POST --url 'http://mysite.net/rest/api/3/project' --user 'usermail:api key'
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--data '{
"notificationScheme": 10021,
"description": "Example Project description",
"lead": "Julien",
"url": "http://mysite.atlassian.net",
"projectTemplateKey": "com.atlassian.servicedesk:simplified-internal-service-desk",
"avatarId": 10200,
"name": "TESTAPI",
"assigneeType": "PROJECT_LEAD",
"projectTypeKey": "service_desk",
"key": "TESTAPI",
"categoryId": 10120
}'
what should I change ?
THx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Administrateur Hawaii Can you please elaborate on the error you are getting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh sry I forgot half of the message...
So Curl tells me that http protocol isn't supported. I mean I did exactly as in the tutorial this is going to make me crazy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oh! it is simple error, replace all your 'http' instance with 'https', Jira Cloud doesn't work on http, it only work on https, and hence the error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not xD Same error https not supported or deactivated in libcurl. So I tried removing quotes from host then I get html with unauthorized error.
Then curl says :
curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: notificationScheme
curl: (6) Could not resolve host: 10021,
curl: (6) Could not resolve host: description
curl: (6) Could not resolve host: Example Project description,
I mean why would it think this parameters are used for host, they are not..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Administrateur Hawaii the code below I have added to test.sh file and excuted, and it worked for me, please check.
#!/bin/bash
curl --request POST \
--url 'https://<SITE>.atlassian.net/rest/api/3/project' \
--user '<EMAIL>:<TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"description": "My Example Project",
"projectTemplateKey": "com.atlassian.servicedesk:simplified-it-service-desk",
"name": "Example Project",
"assigneeType": "PROJECT_LEAD",
"projectTypeKey": "service_desk",
"key": "EXP",
"leadAccountId": "<MY_ACCOUNT_ID>"
}'
You can later run this file,
$ chmod +x text.sh
$ ./test.sh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"was expecting double-quote to start field name\"
That's what I get :/ I'm on Windows by the way :) Maybe that's why it does that.
EDIT: Ok next step I get the error "this project template does not exist..."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
curl --request POST \
--url 'https://yoursite/rest/api/3/project' \
--user 'usermail:<apikey>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"description": "My Example Project",
"projectTemplateKey": "com.atlassian.servicedesk:itil-v2-service-desk-project",
"name": "Example Project",
"assigneeType": "PROJECT_LEAD",
"projectTypeKey": "service_desk",
"key": "EXP",
"leadAccountId": "<accountid>"
}'
This worked perfectly :)
By the way to found account id : people>select account > last alphanumeric part of url ex in bold here : /aaazer1651ezgfzeg156
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great work @Administrateur Hawaii
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Get started with Jira Service Management
These short, self-paced courses will help you get up and running in Jira Service Management in just 90 minutes.
Learning Path
Adopt ITSM practices with Jira Service Management
Use this path to build your IT Service Management knowledge and earn an Atlassian certification.
Setting Up ITSM Projects in Jira Service Management
This training series helps you get started in Jira Service Management quickly with the new ITSM project template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.