-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an example of issue creation #44
base: master
Are you sure you want to change the base?
Changes from all commits
4456ee7
dac3bfb
a467755
9ada1b2
64bacdd
58a5320
643c6f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,10 @@ | ||
# Jira Api Rest Client | ||
# Jira Api Rest Client (Forked) | ||
|
||
[](http://travis-ci.org/chobie/jira-api-restclient) | ||
For usage, example and licence please see the original README : https://github.com/chobie/jira-api-restclient/blob/master/README.md | ||
|
||
## Improvements | ||
|
||
you know JIRA5 supports REST API. this is very useful to make some custom notifications and automated jobs. | ||
(JIRA also supports email notification, but it's too much to custom templates, notification timing. unfortunately it requires Administration permission.) | ||
this API library will help your problems regarding JIRA. hope you enjoy it. | ||
* Curl Driver : Enable support for file upload (PHP >= 5.6) | ||
* New example for Issue creation | ||
|
||
# Usage | ||
|
||
composer.json | ||
|
||
``` | ||
composer require chobie/jira-api-restclient 2.0.* | ||
``` | ||
|
||
|
||
````php | ||
<?php | ||
$api = new chobie\Jira\Api( | ||
"https://your-jira-project.net", | ||
new chobie\Jira\Api\Authentication\Basic("yourname", "password") | ||
); | ||
|
||
$walker = new chobie\Jira\Issues\Walker($api); | ||
$walker->push("project = YOURPROJECT AND (status != closed and status != resolved) ORDER BY priority DESC"); | ||
foreach ($walker as $issue) { | ||
var_dump($issue); | ||
// send custom notification here. | ||
} | ||
```` | ||
|
||
# License | ||
|
||
MIT License | ||
|
||
# JIRA5 Rest API Documents | ||
|
||
https://developer.atlassian.com/static/rest/jira/6.0.html |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert changes to this file. |
||
"name": "chobie/jira-api-restclient", | ||
"description": "JIRA REST API.", | ||
"name": "t-keller/jira-api-restclient", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To use your fork instead of original package you need to specify this in your "repositories": [
{
"type": "vcs",
"url": "https://github.com/t-keller/jira-api-restclient"
}
], |
||
"description": "Jira REST API Wrapper", | ||
"keywords": ["jira","rest","api"], | ||
"type": "library", | ||
"license": "MIT", | ||
|
@@ -9,6 +9,10 @@ | |
"name": "Shuhei Tanuma", | ||
"homepage": "http://chobie.github.io/", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Thomas Keller", | ||
"homepage": "https://github.com/t-keller" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
require dirname(__FILE__) ."/common.php"; | ||
|
||
$api = getApiClient(); | ||
$api->createIssue('<Projet Key>', '<Summary>', '<Task Type Id>', array( | ||
'description' => '<Issue Description>' | ||
)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ public function sendRequest($method, $url, $data = array(), $endpoint, Authentic | |
if ($method == "POST") { | ||
curl_setopt($curl, CURLOPT_POST, 1); | ||
if ($isFile) { | ||
curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would result in an error prior PHP 5.5, where this option was added. Please remove from this PR. This was fixed in #52 . |
||
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); | ||
} else { | ||
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert changes to this file.