Hi
I have looked at the couple of threads but not able to create project out of it.
Following is my code
var _serviceUrl = Helper.Configuration.JIRAUrl + "/rest/api/3/project";
var payLoad = "{ \"key\": \"" + projectName.Substring(0, 2) + "\"," +
" \"name\": \"" + projectName + "\"," +
" \"projectTypeKey\": \"software\"," +
" \"projectTemplateKey\": \"com.pyxis.greenhopper.jira:gh-simplified-kanban\"," +
" \"description\": \"Example Project description\"," +
" \"lead\": \"admin\""+
"}";
var ItemValue = new StringContent(payLoad, Encoding.UTF8, "application/json");
var result = HttpJIRAOnline("POST", _serviceUrl, ItemValue);
Error:
{StatusCode: 400, ReasonPhrase: '', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
ATL-TraceId: 3469dd6db518f35e
X-AREQUESTID: a3c279a0-c613-4ca9-9014-68020009f304
X-AACCOUNTID: 5d9c784b45fad00dc1261cf1
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked
Timing-Allow-Origin: *
X-Content-Type-Options: nosniff
Micros-Issuer: micros/edge-authenticator
Connection: close
Expect-CT: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400
Cache-Control: no-store, no-transform, no-cache
Date: Fri, 22 May 2020 02:58:54 GMT
Set-Cookie: atlassian.xsrf.token=fb415e15-0205-48ba-b4f2-84da32e6dedb_7a20f41075af6f3e3deabaa2bf29b773bc0c2fcf_lin; Path=/; Secure
Server: AtlassianProxy/1.15.8.1
Content-Type: application/json; charset=UTF-8
}}
@Sunil Singh Welcome to the community.
HTTP Status Code 400 for this API implies that you are passing in some wrong values for project object.
Here is brief idea,
projectTemplateKey - you are not passing correct value here 'com.pyxis.greenhopper.jira:gh-simplified-kanban' doesn't exists, it should be 'com.pyxis.greenhopper.jira:gh-simplified-kanban-classic'
I hope these changes will resolve your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks For the help. However, someone really needs to update the documentation, my final Payload is this:
I had to say software instead of Software
{ "key": "DE", "name": "Debug99", "projectTypeKey": "software", "projectTemplateKey": "com.pyxis.greenhopper.jira:gh-simplified-kanban-classic", "description": "Example Project description", "leadAccountId": "5d9d96980336040dbfcbc3c6"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.