FayP / JIRA-php

a php class specifically to be used for JIRA's REST API and also a REST Request class which can be more widely used.
26 stars 22 forks source link

How to use #6

Open vaclavgreif opened 11 years ago

vaclavgreif commented 11 years ago

Hi, kinf of lost, could you please give me an example how to use your class to retrieve a list of projects?

Thanks

vaclavgreif commented 11 years ago

Ok, I found out how to use, most of the functions work, but I have troubles to create new issue. This is my code:

[code] <?php include 'lib/Jira.php'; include 'lib/RestRequest.php';

$config = array('username' => 'username', 'password' => 'pass', 'host' => 'jira.domain.com');

$issue = new Jira($config);

// vytvoreni issue $new_issue = array( 'fields' => array( 'project' => array('key' => 'Test'), 'summary' => 'Test via REST', 'description' => 'Description of issue goes here.', 'issuetype' => array('name' => 'Bug') ) );

$data = json_encode($new_issue); var_dump($issue->createIssue($data));

[/code]

This returns false. Anything I'm doing wrong?