简体   繁体   中英

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

I am trying to create an Issue in JIRA(v6.2.5) through PHP script using JIRA SOAP API.

Code:

$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);

Output :

Issue is being craeted with all the fields.

Problem I am facing

Status of the issue is " OPEN " (whose numerical mapped value in JIRA is 6 ) instead of " IN PROGRESS " (Numerical mapped value in JIRA is 3 ).

So Can anyone help me to assign In Progress in stead of Open .

Thanks in advance.

I would recommend not using SOAP as the 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

But to answer your question when you create an issue in JIRA you cannot specify the starting status, it will be in the initial Status as defined by the workflow.

You would need to first create the issue and then transition it into the correct status following the transitions that are defined in your workflow to get to the right status.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM