I'm using php and got output from JIRA API like below which connects to tool using https://github.com/chobie/jira-api-restclient/blob/master/README.md. It fetches records very fine but i just want few information from all records so written below code with print_r($issue['description'])
but it throws error:
Uncaught Error: Cannot use object of type chobie\Jira\Issue as array
What changes do I need to make in place of $issue to get these 3 information -
[id:protected]
,[description]
and[name]
.How do I count total bugs found for e.g. number of chobie\Jira\Issue Object found?
Code:
$walker = new Walker($api);
$walker->push(
'project = "SEA" AND (status != "closed" AND status != "resolved") ORDER BY priority DESC'
);
foreach ( $walker as $issue ) {
print "<pre>";
print_r($issue);
print "</pre>";
}
So $issue prints everything like below but i just want to get [id:protected], [description] and [name]. What changes i need to make in place of $issue to get these 3 information. Can someone please give me some hint?
JSON:
chobie\Jira\Issue Object
(
[id:protected] => 21373505
[self:protected] => https://test.corp.com/rest/api/2/issue/21373505
[key:protected] => S12E-7337
[fields:protected] => Array
(
[Status] => Array
(
[self] => https://test.corp.com/rest/api/2/status/3
[description] => Working on the issue
[iconUrl] => https://test.corp.com/images/icons/statuses/assigned.png
[name] => In Progress
[id] => 3
[statusCategory] => Array
(
[self] => https://test.corp.com/rest/api/2/statuscategory/4
[id] => 4
[key] => indeterminate
[colorName] => yellow
[name] => In Progress
)
)
)
chobie\Jira\Issue Object
(
[id:protected] => 74534233
[self:protected] => https://test.corp.com/rest/api/2/issue/74534233
[key:protected] => ASE-7327
[fields:protected] => Array
(
[Status] => Array
(
[self] => https://test.corp.com/rest/api/2/status/3
[description] => This issue is being actively worked on at the moment by the assignee.
[iconUrl] => https://test.corp.com/images/icons/statuses/assigned.png
[name] => In Progress
[id] => 3
[statusCategory] => Array
(
[self] => https://test.corp.com/rest/api/2/statuscategory/4
[id] => 6
[key] => indeterminate
[colorName] => yellow
[name] => In Progress
)
)
)