繁体   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