使用 JIRA SOAP API 和 PHP 创建 JIRA 问题时添加它的状态

Add status for JIRA Issue while creating it using JIRA SOAP API and PHP

我正在尝试使用 JIRA SOAP API.

通过 PHP 脚本在 JIRA(v6.2.5) 中创建问题

代码:

$soapClient = new SoapClient("http://jira.xxx.com/jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('username', 'passwd') or die('Username/Password is not correct!');
$issue = array(
    'type' => 2,
    'priority' => 3,
    'project' => 'TEST',
    'versions' => 'TEST',
    'summary' => 'Doing POC',
    'assignee' => 'samj1',
    'status'=> '3'
);
$soapClient->createIssue($token, $issue);

输出:

正在创建所有字段的问题。

我面临的问题

Status 问题是“OPEN”(其在 JIRA 中的数值映射值为 6) 而不是“进行中”(JIRA 中的数字映射值为 3)。

所以谁能帮我分配 In Progress 而不是 Open.

提前致谢。

我建议不要使用 SOAP 作为 documentation states:

JIRA's SOAP and XML-RPC remote APIs have been deprecated since JIRA 6.0 and will be removed in JIRA 7.0

但是要回答您在 JIRA 中创建问题时的问题,您无法指定起始状态,它将处于工作流定义的初始状态。

您需要先创建问题,然后按照工作流程中定义的转换将其转换为正确的状态,以达到正确的状态。