Skip to content

Commit

Permalink
Add a sample to create an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed Apr 4, 2016
1 parent 97802e7 commit ed0aff9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions samples/create_issue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
include dirname( dirname( __FILE__ ) ) . '/MantisPhpClient.php';

# TODO:
# Set the username
# Set the api token or password
# Set the project name
# Set the url
#
# For information about API tokens, check the following blog post:
# http://blog.mantishub.com/2015/12/21/using-api-tokens-to-access-mantishub/

$mantis_user = 'username';
$mantis_pass = 'api-token-or-password'; # API token (v1.3) or password (v1.2)
$mantis_project = 'project-name';
$mantis_url = 'https://mantis.example.com';

$mantis = new MantisPhpClient( $mantis_url, $mantis_user, $mantis_pass, 'SampleCreateIssue/v1.0' );

$issue = array(
'project' => array( 'name' => $mantis_project ),
'category' => 'General',
'summary' => 'Sample Summary ' . time(),
'description' => 'Sample Description ' . time(),
);

$return = $mantis->addIssue( $issue );

0 comments on commit ed0aff9

Please sign in to comment.