簡體   English   中英

通過REST API - PHP在選項卡式屏幕上創建JIRA問題

[英]Create JIRA issue on a tabbed screen via REST API - PHP

我有以下帶有TABS的JIRA屏幕,我想通過REST API在“Resquestor Details”選項卡上創建一個vISSUE。 在此輸入圖像描述

現在我有以下代碼,我不知道在哪里指定選項卡名稱。

 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;
}

我查看了文檔,但我沒有真正理解它或在任何地方看到它。

我收到此錯誤:

無法設定。 它不在適當的屏幕上,或未知。 對於所有字段但字段是正確的問題類型和權限也是正確的。

如果您使用JIRA Rest API創建問題,即。 POST / rest / api / 2 / issue ,然后您不需要考慮在JIRA中查看問題時顯示的選項卡。 您只需在發布到JIRA的json中設置所有需要的字段和自定義字段。

您沒有列出發送給JIRA的確切內容,因此我不完全確定您使用的REST資源。

您提到的錯誤表示您正在嘗試設置項目“創建屏幕”上不可用的字段。 您可以使用GET / rest / api / 2 / issue / createmeta資源進行驗證。 可能它的輸出沒有列出您嘗試設置的所有字段。

要糾正此問題,您必須驗證項目使用的屏幕方案,並確保與方案關聯的“創建屏幕”列出必要的字段。 相關的JIRA文檔可在此處獲得

作為旁注:您在查看問題時看到的選項卡是在項目屏幕方案的“查看問題”屏幕中定義的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM