Creating JIRA issue on tabbed screen via REST API - PHP

I have the following JIRA screen with TABS, and I would like to create vISSUE in the "Resquestor Details" tab through the REST API. enter image description here "

Now I have the following code, and I'm not sure where to specify the name of the tab.

public function createTestData($firstName, $surname, $userID, $email, $testPortfolio, $projectName,$projectID, $newSystem, $newProduct, $requirementsFunction, $evinronment, $dueDate, $region, $summary, $description) { if ($this->finduser($email) < 1) { $json = Array ( "fields" => Array ( "project" => Array ( "id" => 20207 ), "summary" => "$summary", "description"=>"$description", "issuetype" => Array ( "name" => "Test Data" ), "customfield_14421" => "$firstName", "customfield_15026" =>"$lastName", "customfield_14490" =>"$userID", "customfield_14415" =>"$email", "customfield_156681" =>Array ("value" => "$testPortfolio"), "customfield_12103" =>"$projectName", "customfield_14236" =>"$projectID", "customfield_14430" =>"$newSystem", "customfield_15672" =>"$newProduct", "customfield_15673" =>Array ("value" => "$requirementsFunction"), "customfield_15685" =>Array ( "value" => "$environment"), "customfield_15700" =>"$region", "reporter" =>Array ("name" => "API" ) ) ); } return $json; } 

I looked at the Documentation , but I really do not understand it or do not see it.

I get this error:

cannot be installed. It is not on the appropriate screen or is unknown. for all fields But the fields are on the correct problem. The type and permissions are also correct.

+6
source share
1 answer

If you use the JIRA Rest API to create a problem, that is. POST / rest / api / 2 / issue , you do not need to think about the tabs displayed when viewing the problem in JIRA. You just need to set all the required fields and custom fields in json that you send to JIRA.

You did not specify the exact content that you submit to JIRA, so I'm not quite sure which REST resource you are using.

The error you indicated indicates that you are trying to set a field that is not available on the Create Screen screen for your project. You can verify this using the GET / rest / api / 2 / issue / createmeta resource . Probably its output does not display all the fields that you are trying to set.

To fix this, you should check the screen layout that your project uses and make sure that the one associated with the Create Screen layout contains a list of required fields. Relevant JIRA documentation is available here .

As a side element: the tabs that you see when viewing the problem are defined on the "View Problem" screen of the project screen layout.

0
source

All Articles