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
Solved! Go to Solution.
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
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.
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.
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..
@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
"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..."
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
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Get the most out of Jira Service Management
Solve customer problems efficiently and deliver outstanding service experiences.
Learning Path
Adopt ITSM practices to deliver exceptional service
Become familiar with the principles and practices that drive ITSM. Then, learn how to configure and use Jira Service Management to implement them.
Atlassian Certified Associate
Jira Service Management Agent Essentials certification
Prove you know what's essential to providing efficient and resolution-focused service in Jira Service Management.