PHP code example of jedi58 / jira-integration

1. Go to this page and download the library: Download jedi58/jira-integration library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jedi58 / jira-integration example snippets


$auth = Authentication::getInstance(
    'https://jira.atlassian.com'
    'user','password'
);

$case = Issue::getInstance()->simpleCreate(
    'DEMO',
    'A test ticket',
    'There is an issue here - please fix it',
    'Bug',
    array(
        'originalEstimate' => '1d 2h 25m'
        'remainingEstimate' => ''
    )
);

$case_id = Issue::getInstance()->create(array('fields' => array(
    'project' => array(
        'key' => 'DEMO'
    ),
    'summary' => 'A test ticket',
    'description' => 'There is an issue here - please fix it',
    'issuetype' => array(
        'name' => 'Bug'
    )
)));

$case = Issue::getInstance()->update('DEMO-1234', array('fields' => array(
    'summary' => 'This is the new description of the ticket'
)));

$case = Issue::getInstance()->delete('DEMO-1234');

$ticket = Issue::getInstance()->get('DEMO-123');

Comment::getInstance()->create('DEMO-123', 'This is a comment!', array(
    'type' => 'role',
    'value' => 'Administrators'
));

$projects = Project::getInstance()->getAll();

$issue_types = Issue::getInstance()->getIssueTypes();

$available_config = Issue::getInstance()->getProjectIssueAvailableConfig('SUP');

$custom = Issue::getInstance()->getCustomFieldOption(1);

$users = User::getInstance()->getAll();