updating status in jira via php

2019-03-06 12:50发布

im using a email client that i build to update jira tasks. i have managed to change the assignee and the summary through it. but i cannot seems to find a way to update the status. following is the code i used.

$resolution->id="4";
$update->transitions= array($resolution);
$queryIssue = new Jira($config);
$queryIssue->updateTransition($query,$update);

the class:

public function updateTransition($issueKey,$json){
$this->request->openConnect('https://'.$this->host.'/rest/api/latest/issue/REC-143/transitions?', 'POST', $json);
$this->request->execute(); 
}

this gives me an error saying Missing 'transition' identifier what am i doing wrong here.please let me know.

标签: php rest jira
2条回答
Rolldiameter
2楼-- · 2019-03-06 13:14

the way i input the json was incorrect.it should be,

$resolution->transition->id ="4";
$queryIssue->updateTransition('11205',$resolution);

like this. and by the way i used this library to do all my needs with jira. the things which are not included here, i had to implement by my self. which is easy if you know the api urls.take a look at the rest api documentation for the suitable apis you may require.

查看更多
时光不老,我们不散
3楼-- · 2019-03-06 13:31

Well you're missing the "transition identifier" as it says in the error you're getting.

What library are you using?

Is this a custom class you wrote or?

Provide it with a link so that we could check.

查看更多
登录 后发表回答