I am trying to create issue using REST API in PHP. Here is my code
$headers = array(
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Bearer' => $access_token
);
$body = <<<REQUESTBODY
{
"fields": {
"project":
{
"key": "<TEST>"
},
"issuetype": {
"id": "<ID>"
}
}
}
REQUESTBODY;
$response = Unirest\Request::post(
'https://yourdomain.atlassian.net/rest/api/3/issue',
$headers,
$body
);
But it returns
[issuetype] => The issue type selected is invalid.
[project] => Anonymous users do not have permission to create issues in this project. Please try logging in first.
I got the issueType ID from "rest/api/latest/issuetype"
Where do I need to add access. I need anonymous users to create issues.
Any help will be appreciated.