lesstif / php-jira-rest-client

PHP classes interact Jira with the REST API.
Other
510 stars 263 forks source link

[Request] IssueType Management #351

Closed RaXaR closed 4 years ago

RaXaR commented 4 years ago

Hello, I tried to create a new Issue on an existing Project but couldn't because the IssueType is rejected by the API. I tried both a new IssueType object as well as a string.

CURL HTTP Request Failed: Status Code : 400, URL:https://<host_name_removed>.atlassian.net/rest/api/2/issue
Error Message : {"errorMessages":[],"errors":{"issuetype":"The issue type selected is invalid."}}

I scrolled through the source code for this plugin but saw that there isn't a section specifically for IssueTypes yet. Here is the JIRA API documentation regarding IssueTypes.

Could this possibly be implemented?

lesstif commented 4 years ago

hi @RaXaR

you could reach out issueType field using setIssueType method like below.

 $issueField = new IssueField();

    $issueField->setProjectKey("TEST")
                ->setSummary("something's wrong")
                ->setAssigneeName("lesstif")
                ->setPriorityName("Critical")
                ->setIssueType("Bug");

i guess from the server's response error message, it seems to be occurred by invalid issue type string.

if you are using localization jira instance, check issue type string is translated.

RaXaR commented 4 years ago

Hi @lesstif thanks for the response.

I have since discovered that there is a whole string of issue with our setup. One of which is that the user we used to connect to the JIRA API does not have proper permissions to create issues.

I think I'm going to close this ticket, still, thank you very much for the assistance.