I am trying to create a new project in Jira from Powershell using REST API.
I have the following code, but it is giving me http error 400. I can't figure out where the problem is, most likely in the json part, but how to pinpoint the exact error?
$npuri = "$baseurl/rest/api/2/project"
$npjson = "{ `"key`": `"MNew`",
`"name`": `"M Software Sample`",
`"projectTypeKey`": `"business`",
`"projectTemplateKey`": `"com.atlassian.jira-core-project-templates:jira-core-project-management`"
, `"description`": `"Example Project description`"
`"lead`": `"userid`",
`"assigneeType`": `"PROJECT_LEAD`",
`"avatarId`": 10262,
`"permissionScheme`": 10342,
`"notificationScheme`": 10000,
`"categoryId`": 10120
}"
$response=Invoke-RestMethod -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -ContentType "application/json" -Uri $npuri -Body $npjson -Method POST
A basic query using same base URL and authentication works.