{"id":13405330,"url":"https://github.com/lesstif/php-jira-rest-client","last_synced_at":"2026-01-11T13:39:10.272Z","repository":{"id":26561379,"uuid":"30015369","full_name":"lesstif/php-jira-rest-client","owner":"lesstif","description":"PHP classes interact Jira with the REST API.","archived":false,"fork":false,"pushed_at":"2024-04-22T13:19:06.000Z","size":1092,"stargazers_count":504,"open_issues_count":11,"forks_count":257,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-05-16T07:05:21.120Z","etag":null,"topics":["jira","jira-client","jira-rest-api","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lesstif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-29T10:28:34.000Z","updated_at":"2024-06-18T10:57:22.970Z","dependencies_parsed_at":"2024-03-24T13:38:15.593Z","dependency_job_id":"fd1954cd-7033-43ab-87d5-4709e6108c2c","html_url":"https://github.com/lesstif/php-jira-rest-client","commit_stats":{"total_commits":609,"total_committers":123,"mean_commits":4.951219512195122,"dds":"0.47126436781609193","last_synced_commit":"e73164279ffec025e3d5fbe6433cc494e71fa73f"},"previous_names":[],"tags_count":152,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesstif%2Fphp-jira-rest-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesstif%2Fphp-jira-rest-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesstif%2Fphp-jira-rest-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lesstif%2Fphp-jira-rest-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lesstif","download_url":"https://codeload.github.com/lesstif/php-jira-rest-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243554303,"owners_count":20309908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jira","jira-client","jira-rest-api","php"],"created_at":"2024-07-30T19:01:59.129Z","updated_at":"2026-01-11T13:39:10.226Z","avatar_url":"https://github.com/lesstif.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# PHP JIRA Rest Client\n\n[![Latest Stable Version](https://poser.pugx.org/lesstif/php-jira-rest-client/v/stable)](https://packagist.org/packages/lesstif/php-jira-rest-client)\n[![Latest Unstable Version](https://poser.pugx.org/lesstif/php-jira-rest-client/v/unstable)](https://packagist.org/packages/lesstif/php-jira-rest-client)\n[![Build Status](https://travis-ci.org/lesstif/php-jira-rest-client.svg?branch=master)](https://travis-ci.org/lesstif/php-jira-rest-client)\n[![StyleCI](https://styleci.io/repos/30015369/shield?branch=main\u0026style=flat)](https://styleci.io/repos/30015369)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lesstif/php-jira-rest-client/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/lesstif/php-jira-rest-client/?branch=main)\n[![Coverage Status](https://coveralls.io/repos/github/lesstif/php-jira-rest-client/badge.svg)](https://coveralls.io/github/lesstif/php-jira-rest-client)\n[![License](https://poser.pugx.org/lesstif/php-jira-rest-client/license)](https://packagist.org/packages/lesstif/php-jira-rest-client)\n[![Total Downloads](https://poser.pugx.org/lesstif/php-jira-rest-client/downloads)](https://packagist.org/packages/lesstif/php-jira-rest-client)\n[![Monthly Downloads](https://poser.pugx.org/lesstif/php-jira-rest-client/d/monthly)](https://packagist.org/packages/lesstif/php-jira-rest-client)\n[![Daily Downloads](https://poser.pugx.org/lesstif/php-jira-rest-client/d/daily)](https://packagist.org/packages/lesstif/php-jira-rest-client)\n\n# On-Premise only\nIf you want to interact with Jira cloud instead of On-Premise(Server, Data Center), [check out this repository](https://github.com/lesstif/php-JiraCloud-RESTAPI).\n\nFrom version \u003e= 5.0.0 of this repository this project is only using V2 of the Jira rest API, to use V3 [check out this repository](https://github.com/lesstif/php-JiraCloud-RESTAPI).\n\n# Requirements\n\n- PHP \u003e= 8.0\n- [php JsonMapper](https://github.com/netresearch/jsonmapper)\n- [phpdotenv](https://github.com/vlucas/phpdotenv)\n\n# Installation\n\n1. Download and Install PHP Composer.\n\n   ``` sh\n   curl -sS https://getcomposer.org/installer | php\n   ```\n\n2. Next, run the Composer command to install the latest version of php jira rest client.\n   ``` sh\n   php composer.phar require lesstif/php-jira-rest-client\n   ```\n    or add the following to your composer.json file.\n   ```json\n   {\n       \"require\": {\n           \"lesstif/php-jira-rest-client\": \"^5.0\"\n       }\n   }\n   ```\n\n3. Then run Composer's install or update commands to complete installation. \n\n   ```sh\n   php composer.phar install\n   ```\n\n4. After installing, you need to require Composer's autoloader:\n\n   ```php\n   require 'vendor/autoload.php';\n   ```\n\n**Laravel:** Once installed, if you are not using automatic package discovery, then you need to register the `JiraRestApi\\JiraRestApiServiceProvider` service provider in your `config/app.php`.\n\n# Configuration\n\nyou can choose loads environment variables either 'dotenv' or 'array'.\n\n## use dotenv\n\nIf you want to use Dotenv based configuration,first of all, you have to install dependency.\n\n```sh\ncomposer require vlucas/phpdotenv\n```\n\nthen copy .env.example file to .env on your project root.\t\n\n```sh\nJIRA_HOST='https://your-jira.host.com'\nJIRA_USER='jira-username'\nJIRA_PASS='jira-password-OR-api-token'\n# if TOKEN_BASED_AUTH set to true, ignore JIRA_USER and JIRA_PASS.\nTOKEN_BASED_AUTH=true\nPERSONAL_ACCESS_TOKEN='your-access-token-here'\n# to enable session cookie authorization\n# COOKIE_AUTH_ENABLED=true\n# COOKIE_FILE=storage/jira-cookie.txt\n# if you are behind a proxy, add proxy settings\nPROXY_SERVER='your-proxy-server'\nPROXY_PORT='proxy-port'\nPROXY_USER='proxy-username'\nPROXY_PASSWORD='proxy-password'\n```\n\n**Important Note:**\nAs of March 15, 2018, in accordance to the [Atlassian REST API Policy](https://developer.atlassian.com/platform/marketplace/atlassian-rest-api-policy/), Basic auth with password to be deprecated.\nInstead of password, you should using [API token](https://confluence.atlassian.com/cloud/api-tokens-938839638.html).\n\n**Laravel Users:** \nIf you are developing with laravel framework(5.x), you must append above configuration to your application .env file.\n\n## use array\n\ncreate Service class with ArrayConfiguration parameter.\n\n```php\nuse JiraRestApi\\Configuration\\ArrayConfiguration;\nuse JiraRestApi\\Issue\\IssueService;\n\n$iss = new IssueService(new ArrayConfiguration(\n          [\n               'jiraHost' =\u003e 'https://your-jira.host.com',\n                // Basic authentication deprecated \n                /*                 \n                 'jiraUser' =\u003e 'jira-username',\n                'jiraPassword' =\u003e 'jira-password-OR-api-token',\n                */\n               // instead,you can use the token based authentication. \n               'useTokenBasedAuth' =\u003e true,\n               'personalAccessToken' =\u003e 'your-token-here',\n                \n                // custom log config\n               'jiraLogEnabled' =\u003e true,\n               'jiraLogFile' =\u003e \"my-jira-rest-client.log\",\n               'jiraLogLevel' =\u003e 'INFO',\n        \n               // to enable session cookie authorization (with basic authorization only)\n               'cookieAuthEnabled' =\u003e true,\n               'cookieFile' =\u003e storage_path('jira-cookie.txt'),\n               // if you are behind a proxy, add proxy settings\n               'proxyServer' =\u003e 'your-proxy-server',\n               'proxyPort' =\u003e 'proxy-port',\n               'proxyUser' =\u003e 'proxy-username',\n               'proxyPassword' =\u003e 'proxy-password',\n          ]\n   ));\n```\n\n# Usage\n\n## Table of Contents\n\n### Project\n- [Create Project](#create-project)\n- [Update Project](#update-project)\n- [Delete Project](#delete-project)\n- [Get Project Info](#get-project-info)\n- [Get All Project list](#get-all-project-list)\n- [Get Project Components](#get-project-components)\n- [Get Project Type](#get-project-type)\n- [Get Project Version](#get-project-version)\n\n### Custom Field\n- [Get All Field list](#get-all-field-list)\n- [Create Custom Field](#create-custom-field)\n\n### Issue\n- [Get Issue Info](#get-issue-info)\n- [Create Issue](#create-issue)\n- [Create Issue - bulk](#create-multiple-issues)\n- [Create Sub Task](#create-sub-task)\n- [Add Attachment](#add-attachment)\n- [Update issue](#update-issue)\n    - [Update Labels](#update-labels)\n    - [Update Fix Versions](#update-fix-versions)\n- [Change assignee](#change-assignee)\n- [Remove issue](#remove-issue)\n- [Perform a transition on an issue](#perform-a-transition-on-an-issue)\n- [Perform an advanced search, using the JQL](#perform-an-advanced-search)\n    - [Simple JQL](#simple-query)\n    - [Simple Query with LinkedIssue](#simple-query-with-linkedissue)\n    - [JQL With pagination](#jql-with-pagination)\n    - [Using JQL Query class](#jql-query-class)\n- [Remote Issue Link](#remote-issue-link)\n    - [Get Remote Issue Link](#get-remote-issue-link)\n    - [Create Remote Issue Link](#create-remote-issue-link)\n- [Issue time tracking](#issue-time-tracking)\n- [Add worklog in Issue](#add-worklog-in-issue)\n- [Edit worklog in Issue](#edit-worklog-in-issue)\n- [Get Issue worklog](#get-issue-worklog)\n- [Add watcher to Issue](#add-watcher-to-issue)\n- [Remove watcher from Issue](#remove-watcher-from-issue)\n- [Send a notification to the recipients](#issue-notify)\n- [Read property](#read-property)\n- [Write property](#write-propert)\n\n### Comment\n- [Add comment](#add-comment)\n- [Get comment](#get-comment)\n- [Delete comment](#delete-comment)\n- [Update comment](#update-comment)\n\n### IssueLink\n\n* [Create Issue Link](#create-issue-link)\n* [Get Issue LinkType](#get-issue-linktype)\n\n### User\n- [Create User](#create-user)\n- [Get User Info](#get-user-info)\n- [Find Users](#find-users)\n- [Find Assignable Users](#find-assignable-users)\n- [Find Users by query](#find-users-by-query)\n- [Delete User](#delete-user)\n- [Update User](#update-user)\n\n### Group\n- [Create Group](#create-group)\n- [Get Users from group](#get-users-from-group)\n- [Add User to group](#add-user-to-group)\n- [Remove User from group](#remove-user-from-group)\n\n### Priority\n- [Get All Priority list](#get-all-priority-list)\n- [Get Priority](#get-priority)\n\n### Attachment\n- [Get attachment Info](#get-attachment-info)\n- [Remove attachment](#remove-attachment)\n\n### Version\n- [Create version](#create-version)\n- [Update version](#update-version)\n- [Delete version](#delete-version)\n- [Get version related issues](#get-version-related-issues)\n- [Get version unresolved issues](#get-version-related-issues)\n\n### Component\n- [Create component](#create-component)\n- [Update component](#update-component)\n- [Delete component](#delete-component)\n\n### Board\n- [Get board list](#get-board-list)\n- [Get board info](#get-board-info)\n- [Get board issues](#get-board-issues)\n- [Get board epics](#get-board-epics)\n\n### Epic\n- [Get epic info](#)\n\n#### Create Project\n\nCreate a new project.\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-createProject)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\Project\\Project;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $p = new Project();\n\n    $p-\u003esetKey('EX')\n        -\u003esetName('Example')\n        -\u003esetProjectTypeKey('business')\n        -\u003esetProjectTemplateKey('com.atlassian.jira-core-project-templates:jira-core-project-management')\n        -\u003esetDescription('Example Project description')\n        -\u003esetLeadName('lesstif')\n        -\u003esetUrl('http://example.com')\n        -\u003esetAssigneeType('PROJECT_LEAD')\n        -\u003esetAvatarId(10130)\n        -\u003esetIssueSecurityScheme(10000)\n        -\u003esetPermissionScheme(10100)\n        -\u003esetNotificationScheme(10100)\n        -\u003esetCategoryId(10100)\n    ;\n\n    $proj = new ProjectService();\n\n    $pj = $proj-\u003ecreateProject($p);\n   \n    // 'http://example.com/rest/api/2/project/10042'\n    var_dump($pj-\u003eself);\n    // 10042 \n    var_dump($pj-\u003eid);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Update Project\n\nUpdate a project.\nOnly non null values sent in JSON will be updated in the project.\n\nValues available for the assigneeType field are: 'PROJECT_LEAD' and 'UNASSIGNED'.\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-updateProject)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\Project\\Project;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $p = new Project();\n\n    $p-\u003esetName('Updated Example')\n        -\u003esetProjectTypeKey('software')\n        -\u003esetProjectTemplateKey('com.atlassian.jira-software-project-templates:jira-software-project-management')\n        -\u003esetDescription('Updated Example Project description')\n        -\u003esetLead('new-leader')\n        -\u003esetUrl('http://new.example.com')\n        -\u003esetAssigneeType('UNASSIGNED')\n    ;\n\n    $proj = new ProjectService();\n\n    $pj = $proj-\u003eupdateProject($p, 'EX');\n   \n    var_dump($pj);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Delete Project\n\nDeletes a project.\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-deleteProject)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $proj = new ProjectService();\n\n    $pj = $proj-\u003edeleteProject('EX');\n   \n    var_dump($pj);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Get Project Info\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-getProject)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $proj = new ProjectService();\n\n    $p = $proj-\u003eget('TEST');\n\t\n    var_dump($p);\t\t\t\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Get All Project list\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-getAllProjects)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $proj = new ProjectService();\n\n    $prjs = $proj-\u003egetAllProjects();\n\n    foreach ($prjs as $p) {\n        echo sprintf('Project Key:%s, Id:%s, Name:%s, projectCategory: %s\\n',\n            $p-\u003ekey, $p-\u003eid, $p-\u003ename, $p-\u003eprojectCategory['name']\n        );\t\t\t\n    }\t\t\t\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get Project Components\n\n[See Jira API reference (Get project components)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#project-getProjectComponents)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $proj = new ProjectService();\n\n    $prjs = $proj-\u003egetAllProjects();\n\n    // Extract and show Project Components for every Jira Project\n    foreach ($prjs as $p) {\n        var_export($proj-\u003egetProjectComponents($p-\u003eid));\n    }\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get Project type\n\n[See Jira API reference (get all types)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project/type-getAllProjectTypes)\n\n[See Jira API reference (get type)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project/type-getProjectTypeByKey)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $proj = new ProjectService();\n\n    // get all project type\n    $prjtyps = $proj-\u003egetProjectTypes();\n\n    foreach ($prjtyps as $pt) {\n        var_dump($pt);\n    }\n\n    // get specific project type.\n    $pt = $proj-\u003egetProjectType('software');\n    var_dump($pt);\n\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get Project Version\n\nget all project's versions.\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-getProjectVersions)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $proj = new ProjectService();\n\n    $vers = $proj-\u003egetVersions('TEST');\n\n    foreach ($vers as $v) {\n        // $v is  JiraRestApi\\Issue\\Version\n        var_dump($v);\n    }\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\nor get pagenated project's versions.\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/project-getProjectVersionsPaginated)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $param = [\n        'startAt' =\u003e 0,\n        'maxResults' =\u003e 10,\n        'orderBy' =\u003e 'name',\n        //'expand' =\u003e null,\n    ];\n\n    $proj = new ProjectService();\n\n    $vers = $proj-\u003egetVersionsPagenated('TEST', $param);\n\n    foreach ($vers as $v) {\n        // $v is  JiraRestApi\\Issue\\Version\n        var_dump($v);\n    }\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n\n#### Get All Field List\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/field-getFields)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Field\\Field;\nuse JiraRestApi\\Field\\FieldService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $fieldService = new FieldService();\n\n    // return custom field only. \n    $ret = $fieldService-\u003egetAllFields(Field::CUSTOM); \n    \t\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'testSearch Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### Create Custom Field\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/field-createCustomField)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Field\\Field;\nuse JiraRestApi\\Field\\FieldService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $field = new Field();\n    \n    $field-\u003esetName('New custom field')\n            -\u003esetDescription('Custom field for picking groups')\n            -\u003esetType('com.atlassian.jira.plugin.system.customfieldtypes:grouppicker')\n            -\u003esetSearcherKey('com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher');\n\n    $fieldService = new FieldService();\n\n    $ret = $fieldService-\u003ecreate($field);\n    \n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Field Create Failed : '.$e-\u003egetMessage());\n}\n```\n\nIf you need a list of custom field types(ex. *com.atlassian.jira.plugin.system.customfieldtypes:grouppicker*) , check out [Get All Field list](#get-all-field-list).\n\n#### Get Issue Info\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getIssue)\n\nReturns a full representation of the issue for the given issue key.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $issueService = new IssueService();\n\t\n    $queryParam = [\n        'fields' =\u003e [  // default: '*all'\n            'summary',\n            'comment',\n        ],\n        'expand' =\u003e [\n            'renderedFields',\n            'names',\n            'schema',\n            'transitions',\n            'operations',\n            'editmeta',\n            'changelog',\n        ]\n    ];\n            \n    $issue = $issueService-\u003eget('TEST-867', $queryParam);\n\t\n    var_dump($issue-\u003efields);\t\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\nYou can access the custom field associated with issue through *$issue-\u003efields-\u003ecustomFields* array or through direct custom field id variables(Ex: *$issue-\u003efields-\u003ecustomfield_10300*).\n\n#### Create Issue\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-createIssue)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\IssueField;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $issueField = new IssueField();\n\n    $issueField-\u003esetProjectKey('TEST')\n                -\u003esetSummary('something\\'s wrong')\n                -\u003esetAssigneeNameAsString('lesstif')\n                -\u003esetPriorityNameAsString('Critical')\n                -\u003esetIssueTypeAsString('Bug')\n                -\u003esetDescription('Full description for issue')\n                -\u003eaddVersionAsString('1.0.1')\n                -\u003eaddVersionAsArray(['1.0.2', '1.0.3'])\n                -\u003eaddComponentsAsArray(['Component-1', 'Component-2'])\n                // set issue security if you need.\n                -\u003esetSecurityId(10001 /* security scheme id */)\n                -\u003esetDueDateAsString('2023-06-19')\n                // or you can use DateTimeInterface\n                //-\u003esetDueDateAsDateTime(\n                //            (new DateTime('NOW'))-\u003eadd(DateInterval::createFromDateString('1 month 5 day'))\n                // )\n            ;\n\t\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003ecreate($issueField);\n\t\n    //If success, Returns a link to the created issue.\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\nIf you want to set custom field, you can call the *addCustomField* function with custom field id and value as parameters.\n\n```php\ntry {\n    $issueField = new IssueField();\n\n    $issueField-\u003esetProjectKey('TEST')\n                -\u003esetSummary('something\\'s wrong')\n                -\u003esetAssigneeNameAsString('lesstif')\n                -\u003esetPriorityNameAsString('Critical')\n                -\u003esetIssueTypeAsString('Bug')\n                -\u003esetDescription('Full description for issue')\n                -\u003eaddVersion('1.0.1')\n                -\u003eaddVersion('1.0.3')\n                -\u003eaddCustomField('customfield_10100', 'text area body text') // String type custom field\n                -\u003eaddCustomField('customfield_10200', ['value' =\u003e 'Linux']) // Select List (single choice)\n                -\u003eaddCustomField('customfield_10408', [\n                    ['value' =\u003e 'opt2'], ['value' =\u003e 'opt4']\n                ]) // Select List (multiple choice)\n    ;\n\t\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003ecreate($issueField);\n\t\n    //If success, Returns a link to the created issue.\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\nCurrently, not tested for all custom field types.\n\n#### Create Multiple Issues\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-createIssues)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\IssueField;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $issueFieldOne = new IssueField();\n\n    $issueFieldOne-\u003esetProjectKey('TEST')\n                -\u003esetSummary('something\\'s wrong')\n                -\u003esetPriorityNameAsString('Critical')\n                -\u003esetIssueTypeAsString('Bug')\n                -\u003esetDescription('Full description for issue');\n\n    $issueFieldTwo = new IssueField();\n\n    $issueFieldTwo-\u003esetProjectKey('TEST')\n                -\u003esetSummary('something else is wrong')\n                -\u003esetPriorityNameAsString('Critical')\n                -\u003esetIssueTypeAsString('Bug')\n                -\u003esetDescription('Full description for second issue');\n    \n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003ecreateMultiple([$issueFieldOne, $issueFieldTwo]);\n    \n    //If success, returns an array of the created issues\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Create Sub Task\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-createIssue)\n\nCreating a sub-task is similar to creating a regular issue, with two important method calls:\n\n```php\n-\u003esetIssueTypeAsString('Sub-task')\n-\u003esetParentKeyOrId($issueKeyOrId)\n```\n\nfor example\n​                \n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\IssueField;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $issueField = new IssueField();\n\n    $issueField-\u003esetProjectKey('TEST')\n                -\u003esetSummary('something\\'s wrong')\n                -\u003esetAssigneeNameAsString('lesstif')\n                -\u003esetPriorityNameAsString('Critical')\n                -\u003esetDescription('Full description for issue')\n                -\u003eaddVersion('1.0.1')\n                -\u003eaddVersion('1.0.3')\n                -\u003esetIssueTypeAsString('Sub-task')  //issue type must be Sub-task\n                -\u003esetParentKeyOrId('TEST-143')  //Issue Key\n    ;\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003ecreate($issueField);\n\n    //If success, Returns a link to the created sub task.\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\nIf you want to set custom field, you can call the *addCustomField* function with custom field id and value as parameters.\n\n```php\ntry {\n    $issueField = new IssueField();\n\n    $issueField-\u003esetProjectKey('TEST')\n                -\u003esetSummary('something\\'s wrong')\n                -\u003esetAssigneeNameAsString('lesstif')\n                -\u003esetPriorityNameAsString('Critical')\n                -\u003esetIssueTypeAsString('Bug')\n                -\u003esetDescription('Full description for issue')\n                -\u003eaddVersion('1.0.1')\n                -\u003eaddVersion('1.0.3')\n                -\u003eaddCustomField('customfield_10100', 'text area body text') // String type custom field\n                -\u003eaddCustomField('customfield_10200', ['value' =\u003e 'Linux']) // Select List (single choice)\n                -\u003eaddCustomField('customfield_10408', [\n                    ['value' =\u003e 'opt2'], ['value' =\u003e 'opt4']\n                ]) // Select List (multiple choice)\n    ;\n\t\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003ecreate($issueField);\n\t\n    //If success, Returns a link to the created issue.\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\nCurrently, not tested for all custom field types.\n\n#### Add Attachment\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue/%7BissueIdOrKey%7D/attachments-addAttachment)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n    $issueService = new IssueService();\n\n    // multiple file upload support.\n    $ret = $issueService-\u003eaddAttachments($issueKey, \n        ['screen_capture.png', 'bug-description.pdf', 'README.md']\n    );\n\n    print_r($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'Attach Failed : ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Update issue\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-editIssue)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\IssueField;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\t\t\t\n    $issueField = new IssueField(true);\n\n    $issueField-\u003esetAssigneeNameAsString('admin')\n                -\u003esetPriorityNameAsString('Blocker')\n                -\u003esetIssueTypeAsString('Task')\n                -\u003eaddLabel('test-label-first')\n                -\u003eaddLabel('test-label-second')\n                -\u003eaddVersion('1.0.1')\n                -\u003eaddVersion('1.0.2')\n                -\u003esetDescription('This is a shorthand for a set operation on the summary field')\n    ;\n\n    // optionally set some query params\n    $editParams = [\n        'notifyUsers' =\u003e false,\n    ];\n\n    $issueService = new IssueService();\n\n    // You can set the $paramArray param to disable notifications in example\n    $ret = $issueService-\u003eupdate($issueKey, $issueField, $editParams);\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'update Failed : ' . $e-\u003egetMessage());\n}\n```\n\nIf you want to change the custom field type when updating an issue, you can call the *addCustomField* function just as you did for creating issue.\n\n\n##### Update labels\n\nThis function is a convenient wrapper for add or remove label in the issue.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $issueKey = 'TEST-123';\n\n    $issueService = new IssueService();\n\n    $addLabels = [\n        'triaged', 'customer-request', 'sales-request'\n    ];\n\n    $removeLabel = [\n        'will-be-remove', 'this-label-is-typo'\n    ];\n\n    $ret = $issueService-\u003eupdateLabels($issueKey,\n            $addLabels,\n            $removeLabel,\n            $notifyUsers = false\n        );\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'updateLabels Failed : '.$e-\u003egetMessage());\n}\n```\n\n##### Update fix versions\n\nThis function is a convenient wrapper for add or remove fix version in the issue.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $issueKey = 'TEST-123';\n\n    $issueService = new IssueService();\n\n    $addVersions = [\n        '1.1.1', 'named-version'\n    ];\n\n    $removeVersions = [\n        '1.1.0', 'old-version'\n    ];\n\n    $ret = $issueService-\u003eupdateFixVersions($issueKey,\n            $addVersions,\n            $removeVersions,\n            $notifyUsers = false\n        );\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'updateFixVersions Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### Change Assignee\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-assign)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n\t$issueService = new IssueService();\n\n    // if assignee is -1, automatic assignee used.\n    // A null assignee will remove the assignee.\n    $assignee = 'newAssigneeName';\n\n    $ret = $issueService-\u003echangeAssignee($issueKey, $assignee);\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'Change Assignee Failed : ' . $e-\u003egetMessage());\n}\n```\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n\t$issueService = new IssueService();\n\n    $accountId = 'usre-account-id';\n\n    $ret = $issueService-\u003echangeAssigneeByAccountId($issueKey, $accountId);\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'Change Assignee Failed : ' . $e-\u003egetMessage());\n}\n```   \n\n#### Remove Issue\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-deleteIssue)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003edeleteIssue($issueKey);\n    // if you want to delete issues with sub-tasks\n    //$ret = $issueService-\u003edeleteIssue($issueKey, array('deleteSubtasks' =\u003e 'true'));\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'Remove Issue Failed : ' . $e-\u003egetMessage());\n}\n```\n\n#### Read property\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-properties/#api-rest-api-2-issue-issueidorkey-properties-propertykey-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = \"TEST-879\";\n\ntry {\n    $issueService = new IssueService();\n    $property = $issueService-\u003egetProperty($issueKey, 'com.railsware.SmartChecklist.checklist');\n    \n    var_dump($property);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Write property\n\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-properties/#api-rest-api-2-issue-issueidorkey-properties-propertykey-put)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\Property;\nuse JiraRestApi\\JiraException;\n\n$issueKey = \"TEST-879\";\n\ntry {\n    $issueService = new IssueService();\n    $property = new Property();\n    $property-\u003evalue = \"- First entry\\n- second entry\";\n    $issueService-\u003esetProperty($issueKey, $property);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Add comment\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-addComment)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\Comment;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\t\t\t\n    $comment = new Comment();\n\n    $body = \u003c\u003c\u003cCOMMENT\nAdds a new comment to an issue.\n* Bullet 1\n* Bullet 2\n** sub Bullet 1\n** sub Bullet 2\n* Bullet 3\nCOMMENT;\n\n    $comment-\u003esetBody($body)\n        -\u003esetVisibilityAsString('role', 'Users');\n    ;\n\n    $issueService = new IssueService();\n    $ret = $issueService-\u003eaddComment($issueKey, $comment);\n    print_r($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'add Comment Failed : ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get comment\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getComments)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n    $issueService = new IssueService();\n    \n    $param = [\n         'startAt' =\u003e 0, \n         'maxResults' =\u003e 3,\n         'expand' =\u003e 'renderedBody',\n    ];\n   \n    $comments = $issueService-\u003egetComments($issueKey, $param);\n\n    var_dump($comments);\n\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'get Comment Failed : '.$e-\u003egetMessage());\n}\n```\n\nget comment by comment id\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n    $issueService = new IssueService();\n    \n    $param = [\n         'startAt' =\u003e 0, \n         'maxResults' =\u003e 3,\n         'expand' =\u003e 'renderedBody',\n    ];\n    $commentId = 13805;\n\n    $comments = $issueService-\u003egetComment($issueKey, $commentId, $param);\n\n    var_dump($comments);\n\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'get Comment Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### Delete comment\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-deleteComment)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\n    $commentId = 12345;\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003edeleteComment($issueKey, $commentId);\n\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Delete comment Failed : '.$e-\u003egetMessage());\n}\n\n```\n\n#### Update comment\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-updateComment)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Issue\\Comment;\n\n$issueKey = 'TEST-879';\n\ntry {\n    $commentId = 12345;\n\n    $issueService = new IssueService();\n        \n    $comment = new Comment();\n    $comment-\u003esetBody('Updated comments');\n    \n    $issueService-\u003eupdateComment($issueKey, $commentId, $comment);\n\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Update comment Failed : '.$e-\u003egetMessage());\n}\n\n```\n\n#### Perform a transition on an issue\n\nNote: this library uses goal **status names** instead of **transition names**.\nSo, if you want to change issue status to 'Some Status',\nyou should pass that status name to `setTransitionName`\n\ni.e. `$transition-\u003esetTransitionName('Some Status')`\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-doTransition)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\Transition;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-879';\n\ntry {\t\t\t\n    $transition = new Transition();\n    $transition-\u003esetTransitionName('Resolved');\n    $transition-\u003esetCommentBody('performing the transition via REST API.');\n\n    $issueService = new IssueService();\n\n    $issueService-\u003etransition($issueKey, $transition);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(FALSE, 'add Comment Failed : ' . $e-\u003egetMessage());\n}\n```\n\nNote: If you are JIRA with local language profiles, you must use *setUntranslatedName* instead of *setTransitionName*.\n\ni.e. `$transition-\u003esetUntranslatedName('Done')`\n\n#### Perform an advanced search\n\n##### Simple Query\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/search-searchUsingSearchRequest)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$jql = 'project not in (TEST)  and assignee = currentUser() and status in (Resolved, closed)';\n\ntry {\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003esearch($jql);\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'testSearch Failed : '.$e-\u003egetMessage());\n}\n```\n\n##### Simple Query with LinkedIssue\n\n[See Jira API reference](https://support.atlassian.com/jira-work-management/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-linkedIssueslinkedIssues--)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Issue\\JqlFunction;\n\n// Searches for issues that are linked to an issue. You can restrict the search to links of a particular type. \ntry {\n    $linkedIssue = JqlFunction::linkedIssues('TEST-01', 'IN', 'is blocked by');\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003esearch($linkedIssue-\u003eexpression);\n\n    var_dump($ret);\n} catch (JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n// Searches for epics and subtasks. If the issue is not an epic, the search returns all subtasks for the issue. \ntry {\n    $linkedIssue = JqlFunction::linkedissue('TEST-01');\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003esearch($linkedIssue-\u003eexpression);\n\n    var_dump($ret);\n} catch (JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n##### JQL with pagination\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/search-search)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$jql = 'project not in (TEST)  and assignee = currentUser() and status in (Resolved, closed)';\n\ntry {\n    $issueService = new IssueService();\n\n    $pagination = -1;\n  \n    $startAt = 0;\t//the index of the first issue to return (0-based)    \n    $maxResult = 3;\t// the maximum number of issues to return (defaults to 50). \n    $totalCount = -1;\t// the number of issues to return\n  \n    // first fetch\n    $ret = $issueService-\u003esearch($jql, $startAt, $maxResult);\n    $totalCount = $ret-\u003etotal;\n  \t\n    // do something with fetched data\n    foreach ($ret-\u003eissues as $issue) {\n        print (sprintf('%s %s \\n', $issue-\u003ekey, $issue-\u003efields-\u003esummary));\n    }\n  \t\n    // fetch remained data\n    $page = $totalCount / $maxResult;\n\n    for ($startAt = 1; $startAt \u003c $page; $startAt++) {\n        $ret = $issueService-\u003esearch($jql, $startAt * $maxResult, $maxResult);\n\n        print ('\\nPaging $startAt\\n');\n        print ('-------------------\\n');\n        foreach ($ret-\u003eissues as $issue) {\n            print (sprintf('%s %s \\n', $issue-\u003ekey, $issue-\u003efields-\u003esummary));\n        }\n    }     \n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'testSearch Failed : '.$e-\u003egetMessage());\n}\n```\n\n##### JQL query class\n\n[See Jira API reference](https://confluence.atlassian.com/jiracoreserver/advanced-searching-939937709.html)\n\nIf you're not familiar JQL then you can use convenience JqlQuery class.\nJqlFunction class can be used to add jql functions calls to query.\nYou can find the names of almost all fields, functions, keywords and operators\ndefined as constants in `JqlQuery` and static methods in `JqlFunciton` classes.\nFor more info see the Jira docs (link above).\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\JqlQuery;\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Issue\\JqlFunction;\n\ntry {\n    $jql = new JqlQuery();\n\n    $jql-\u003esetProject('TEST')\n        -\u003esetType('Bug')\n        -\u003esetStatus('In Progress')\n        -\u003esetAssignee(JqlFunction::currentUser())\n        -\u003esetCustomField('My Custom Field', 'value')\n        -\u003eaddIsNotNullExpression('due');\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003esearch($jql-\u003egetQuery());\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'testSearch Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### Remote Issue Link\n\n\n##### get remote issue link\n\n* [See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getRemoteIssueLinks)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-316';\n\ntry {\n    $issueService = new IssueService();\n\n    $rils = $issueService-\u003egetRemoteIssueLink($issueKey);\n        \n    // rils is array of RemoteIssueLink classes\n    var_dump($rils);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, $e-\u003egetMessage());\n}\n\n```\n\n##### create remote issue link\n\n* [See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getRemoteIssueLinks)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\RemoteIssueLink;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-316';\n\ntry {\n    $issueService = new IssueService();\n\n    $ril = new RemoteIssueLink();\n\n    $ril-\u003esetUrl('http://www.mycompany.com/support?id=1')\n        -\u003esetTitle('Remote Link Title')\n        -\u003esetRelationship('causes')\n        -\u003esetSummary('Crazy customer support issue')\n    ;\n\n    $rils = $issueService-\u003ecreateOrUpdateRemoteIssueLink($issueKey, $ril);\n\n    // rils is array of RemoteIssueLink classes\n    var_dump($rils);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Create Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### Issue time tracking\n\nThis methods use `get issue` and `edit issue` methods internally.\n\n[See Jira API reference (get issue)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getIssue)\n\n[See Jira API reference (edit issue)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-editIssue)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\TimeTracking;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n\ntry {\n    $issueService = new IssueService();\n    \n    // get issue's time tracking info\n    $ret = $issueService-\u003egetTimeTracking($this-\u003eissueKey);\n    var_dump($ret);\n    \n    $timeTracking = new TimeTracking;\n\n    $timeTracking-\u003esetOriginalEstimate('3w 4d 6h');\n    $timeTracking-\u003esetRemainingEstimate('1w 2d 3h');\n    \n    // add time tracking\n    $ret = $issueService-\u003etimeTracking($this-\u003eissueKey, $timeTracking);\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'testSearch Failed : '.$e-\u003egetMessage());\n}\n\n```\n\n#### Add worklog in issue\n\n[See Jira API V2 reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-addWorklog)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\Worklog;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n\ntry {\n    $workLog = new Worklog();\n\n    $workLog-\u003esetComment('I did some work here.')\n            -\u003esetStarted('2016-05-28 12:35:54')\n            -\u003esetTimeSpent('1d 2h 3m');\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003eaddWorklog($issueKey, $workLog);\n\n    $workLogid = $ret-\u003e{'id'};\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Create Failed : '.$e-\u003egetMessage());\n}\n\n```\n\n#### edit worklog in issue\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-updateWorklog)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\Worklog;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n$workLogid = '12345';\n\ntry {\n    $workLog = new Worklog();\n\n    $workLog-\u003esetComment('I did edit previous worklog here.')\n            -\u003esetStarted('2016-05-29 13:15:34')\n            -\u003esetTimeSpent('3d 4h 5m');\n\n    $issueService = new IssueService();\n\n    $ret = $issueService-\u003eeditWorklog($issueKey, $workLog, $workLogid);\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Edit worklog Failed : '.$e-\u003egetMessage());\n}\n\n```\n\n#### Get issue worklog\n\n[See Jira API reference (get full issue worklog)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getIssueWorklog)\n\n[See Jira API reference (get worklog by id)](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-getWorklog)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n\ntry {\n    $issueService = new IssueService();\n    \n    // get issue's all worklog\n    $worklogs = $issueService-\u003egetWorklog($issueKey)-\u003egetWorklogs();\n    var_dump($worklogs);\n    \n    // get worklog by id\n    $wlId = 12345;\n    $wl = $issueService-\u003egetWorklogById($issueKey, $wlId);\n    var_dump($wl);\n    \n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'testSearch Failed : '.$e-\u003egetMessage());\n}\n\n```\n\n#### Add watcher to Issue \n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-addWatcher)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n\ntry {\n    $issueService = new IssueService();\n    \n    // watcher's id\n    $watcher = 'lesstif';\n    \n    $issueService-\u003eaddWatcher($issueKey, $watcher);\n    \n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'add watcher Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### Remove watcher from Issue\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-removeWatcher)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n\ntry {\n    $issueService = new IssueService();\n    \n    // watcher's id\n    $watcher = 'lesstif';\n    \n    $issueService-\u003eremoveWatcher($issueKey, $watcher);\n    \n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'add watcher Failed : '.$e-\u003egetMessage());\n}\n```\n\n#### issue notify\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issue-notify)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\IssueService;\nuse JiraRestApi\\Issue\\Notify;\nuse JiraRestApi\\JiraException;\n\n$issueKey = 'TEST-961';\n\ntry {\n    $issueService = new IssueService();\n\n    $noti = new Notify();\n\n    $noti-\u003esetSubject('notify test')\n        -\u003esetTextBody('notify test text body')\n        -\u003esetHtmlBody('\u003ch1\u003enotify\u003c/h1\u003etest html body')\n        -\u003esendToAssignee(true)\n        -\u003esendToWatchers(true)\n        -\u003esendToUser('lesstif', true)\n        -\u003esendToGroup('temp-group')\n    ;\n\n    $issueService-\u003enotify($issueKey, $noti);\n    \n} catch (JiraRestApi\\JiraException $e) {\n    $this-\u003eassertTrue(false, 'Issue notify Failed : '.$e-\u003egetMessage());\n}\n```\n#### Create Issue Link\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issueLink-linkIssues)\n\nThe Link Issue Resource provides functionality to manage issue links.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\IssueLink\\IssueLink;\nuse JiraRestApi\\IssueLink\\IssueLinkService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $il = new IssueLink();\n\n    $il-\u003esetInwardIssue('TEST-258')\n        -\u003esetOutwardIssue('TEST-249')\n        -\u003esetLinkTypeName('Relates' )\n        -\u003esetComment('Linked related issue via REST API.');\n            \n    $ils = new IssueLinkService();\n\n    $ret = $ils-\u003eaddIssueLink($il);\n\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Get Issue LinkType\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/issueLinkType-getIssueLinkTypes)\n\nRest resource to retrieve a list of issue link types.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\IssueLink\\IssueLinkService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $ils = new IssueLinkService();\n\n    $ret = $ils-\u003egetIssueLinkTypes();\n    \n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Create User\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-createUser)\n\nCreate user. \nBy default created user will not be notified with email. If password field is not set then password will be randomly generated.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    // create new user\n    $user = $us-\u003ecreate([\n            'name'=\u003e'charlie',\n            'password' =\u003e 'abracadabra',\n            'emailAddress' =\u003e 'charlie@atlassian.com',\n            'displayName' =\u003e 'Charlie of Atlassian',\n        ]);\n\n    var_dump($user);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get User Info\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-getUser)\n\nReturns a user.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    $user = $us-\u003eget(['username' =\u003e 'lesstif']);\n\n    var_dump($user);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Find Users\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-findUsers)\n\nReturns a list of users that match the search string and/or property. \n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    $paramArray = [\n        'username' =\u003e '.', // get all users. \n        'startAt' =\u003e 0,\n        'maxResults' =\u003e 1000,\n        'includeInactive' =\u003e true,\n        //'property' =\u003e '*',\n    ];\n\n    // get the user info.\n    $users = $us-\u003efindUsers($paramArray);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Find Assignable Users\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-findAssignableUsers)\n\nReturns a list of users that match the search string. \n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    $paramArray = [\n        //'username' =\u003e null,\n        'project' =\u003e 'TEST',\n        //'issueKey' =\u003e 'TEST-1',\n        'startAt' =\u003e 0,\n        'maxResults' =\u003e 50, //max 1000\n        //'actionDescriptorId' =\u003e 1,\n    ];\n\n    $users = $us-\u003efindAssignableUsers($paramArray);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n\n#### Find users by query\n\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-user-search-query-get)\n\nReturns a list of users that match the search string.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    $paramArray = [\n      'query' =\u003e 'is watcher of TEST',\n    ];\n\n    $users = $us-\u003efindUsersByQuery($paramArray);\n    var_dump($users);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### delete User\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-removeUser)\n\nRemoves user.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    $paramArray = ['username' =\u003e 'user@example.com'];\n\n    $users = $us-\u003edeleteUser($paramArray);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### update User\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/user-updateUser)\n\nUpdates user.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\User\\UserService;\n\ntry {\n    $us = new UserService();\n\n    $paramArray = ['username' =\u003e 'user@example.com'];\n\n    // create new user\n    $user = [\n            'name'=\u003e'charli',\n            'password' =\u003e 'abracada',\n            'emailAddress' =\u003e 'charli@atlassian.com',\n            'displayName' =\u003e 'Charli of Atlassian',\n        ];\n\n    $updatedUser = $us-\u003eupdate($paramArray, $user)\n\n    var_dump($updatedUser);\n\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Create Group\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/group-createGroup)\n\nCreate new group.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Group\\GroupService;\nuse JiraRestApi\\Group\\Group;\n\ntry {\n    $g = new Group();\n\n    $g-\u003ename = 'Test group for REST API';\n\n    $gs = new GroupService();\n    $ret = $gs-\u003ecreateGroup($g);\n\n    var_dump($ret);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get Users from group\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/group-getUsersFromGroup)\n\nreturns a paginated list of users who are members of the specified group and its subgroups.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Group\\GroupService;\n\ntry {\n   $queryParam = [\n        'groupname' =\u003e 'Test group for REST API',\n        'includeInactiveUsers' =\u003e true, // default false\n        'startAt' =\u003e 0,\n        'maxResults' =\u003e 50,\n    ];\n\n    $gs = new GroupService();\n\n    $ret = $gs-\u003egetMembers($queryParam);\n\n    // print all users in the group\n    foreach($ret-\u003evalues as $user) {\n        print_r($user);\n    }\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n### Add User to group\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/group-addUserToGroup)\n\nadd user to given group.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Group\\GroupService;\n\ntry {\n    $groupName  = '한글 그룹 name';\n    $userName = 'lesstif';\n\n    $gs = new GroupService();\n\n    $ret = $gs-\u003eaddUserToGroup($groupName, $userName);\n\n    // print current state of the group.\n    print_r($ret);\n\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n### Remove User from group\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/group-removeUserFromGroup)\n\nRemoves given user from a group.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\JiraException;\nuse JiraRestApi\\Group\\GroupService;\n\ntry {\n    $groupName  = '한글 그룹 name';\n    $userName = 'lesstif';\n\n    $gs = new GroupService();\n\n    $gs-\u003eremoveUserFromGroup($groupName, $userName);\n\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get All Priority list\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/priority)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Priority\\PriorityService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $ps = new PriorityService();\n\n    $p = $ps-\u003egetAll();\n\t\n    var_dump($p);\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Get Priority\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/priority)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Priority\\PriorityService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $ps = new PriorityService();\n\n    $p = $ps-\u003eget(1);\n\t\n    var_dump($p);\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Get Attachment Info\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/attachment-getAttachment)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Attachment\\AttachmentService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $attachmentId = 12345;\n\n    $atts = new AttachmentService();\n    $att = $atts-\u003eget($attachmentId);\n\n    var_dump($att);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n\n\nGets the attachment information and saves the attachment into the outDir directory.\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Attachment\\AttachmentService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $attachmentId = 12345;\n    $outDir = 'attachment_dir';\n    \n    $atts = new AttachmentService();\n    $att = $atts-\u003eget($attachmentId, $outDir, $overwrite = true);\n\n    var_dump($att);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n\n#### Remove attachment\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/attachment-removeAttachment)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Attachment\\AttachmentService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $attachmentId = 12345;\n\n    $atts = new AttachmentService();\n\n    $atts-\u003eremove($attachmentId);\n} catch (JiraRestApi\\JiraException $e) {\n\tprint('Error Occured! ' . $e-\u003egetMessage());\n}\n```\n\n#### Create version\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/version-createVersion)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Issue\\Version;\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\Version\\VersionService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $projectService = new ProjectService();\n    $project = $projectService-\u003eget('TEST');\n\n    $versionService = new VersionService();\n\n    $version = new Version();\n\n    $version-\u003esetName('1.0.0')\n            -\u003esetDescription('Generated by script')\n            -\u003esetReleased(true)\n            -\u003esetStartDateAsDateTime(new \\DateTime())\n            -\u003esetReleaseDateAsDateTime((new \\DateTime())-\u003eadd(date_interval_create_from_date_string('1 months 3 days')))\n            -\u003esetProjectId($project-\u003eid)\n            ;\n\n    $res = $versionService-\u003ecreate($version);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Update version\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/version-updateVersion)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Version\\VersionService;\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $versionService = new VersionService();\n    $projectService = new ProjectService();\n\n    $ver = $projectService-\u003egetVersion('TEST', '1.0.0');\n\n    // update version\n    $ver-\u003esetName($ver-\u003ename . ' Updated name')\n        -\u003esetDescription($ver-\u003edescription . ' Updated description')\n        -\u003esetReleased(false)\n        -\u003esetStartDateAsDateTime(new \\DateTime())\n        -\u003esetReleaseDateAsDateTime((new \\DateTime())-\u003eadd(date_interval_create_from_date_string('2 weeks 3 days')))\n        ;\n\n    $res = $versionService-\u003eupdate($ver);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Delete version\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/version-delete)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Version\\VersionService;\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $versionService = new VersionService();\n    $projectService = new ProjectService();\n\n    $version = $projectService-\u003egetVersion('TEST', '1.0.0');\n\n    $res = $versionService-\u003edelete($version);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get version related issues\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/version-getVersionRelatedIssues)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Version\\VersionService;\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $versionService = new VersionService();\n    $projectService = new ProjectService();\n\n    $version = $projectService-\u003egetVersion('TEST', '1.0.0');\n\n    $res = $versionService-\u003egetRelatedIssues($version);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get version unresolved issues\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/version-getVersionUnresolvedIssues)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Version\\VersionService;\nuse JiraRestApi\\Project\\ProjectService;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $versionService = new VersionService();\n    $projectService = new ProjectService();\n\n    $version = $projectService-\u003egetVersion('TEST', '1.0.0');\n\n    $res = $versionService-\u003egetUnresolvedIssues($version);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Create component\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/component-createComponent)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Component\\ComponentService;\nuse JiraRestApi\\Issue\\Version;\nuse JiraRestApi\\Project\\Component;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $componentService = new ComponentService();\n    \n    $component = new Component();\n    $component-\u003esetName('my component')\n              -\u003esetDescription('Generated by script')\n              -\u003esetProjectKey('TEST');\n\n    $res = $componentService-\u003ecreate($component);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Update component\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/component-updateComponent)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Component\\ComponentService;\nuse JiraRestApi\\Issue\\Version;\nuse JiraRestApi\\Project\\Component;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $componentService = new ComponentService();\n    \n    $component = $componentService-\u003eget(10000); // component-id\n    $component-\u003esetName($component-\u003ename . ' Updated name')\n              -\u003esetDescription($component-\u003edescription . ' Updated descrption')\n              -\u003esetLeadUserName($component-\u003elead-\u003ekey);  // bug in jira api\n\n    $res = $componentService-\u003eupdate($component);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n##### Delete component\n\n[See Jira API reference](https://docs.atlassian.com/software/jira/docs/api/REST/latest/#api/2/component-deleteComponent)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Component\\ComponentService;\nuse JiraRestApi\\Issue\\Version;\nuse JiraRestApi\\Project\\Component;\nuse JiraRestApi\\JiraException;\n\ntry {\n    $componentService = new ComponentService();\n    \n    $component = $componentService-\u003eget(10000); // component-id\n\n    $res = $componentService-\u003edelete($component);\n\n    var_dump($res);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n\n#### Get board list\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Board\\BoardService;\n\ntry {\n  $board_service = new BoardService();\n  $board = $board_service-\u003egetBoardList();\n  \n  var_dump($board);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get boards\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Board\\BoardService;\n\ntry {\n  $results = [];\n  $startAt = 0;\n  $maxResults = 50; // maximum allowed for board queries\n\n  do {\n      $response = $this-\u003eboardService-\u003egetBoards([\n        'startAt' =\u003e $startAt,\n        'maxResults' =\u003e $maxResults\n      ]);\n\n      $results = [...$results, ...$response-\u003egetBoards()];\n\n      $startAt += $maxResults;\n\n  } while($startAt \u003c $response-\u003etotal);\n  \n  var_dump($results);\n  \n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n\n\n#### Get board info\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-boardId-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Board\\BoardService;\n\ntry {\n  $board_service = new BoardService();\n  $board_id = 1;\n  $board = $board_service-\u003egetBoard($board_id);\n  \n  var_dump($board);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get board issues\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-boardId-issue-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\nuse JiraRestApi\\Board\\BoardService;\n\ntry {\n  $board_service = new BoardService();\n  $board_id = 1;\n  $issues = $board_service-\u003egetBoardIssues($board_id, [\n    'maxResults' =\u003e 500,\n    'jql' =\u003e urlencode('status != Closed'),\n  ]);\n  \n  foreach ($issues as $issue) {\n    var_dump($issue);\n  }\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get board epics\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-agile-1-0-board-boardId-epic-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\ntry {\n  $board_service = new JiraRestApi\\Board\\BoardService();\n  $board_id = 1;\n  $epics = $board_service-\u003egetBoardEpics($board_id, [\n    'maxResults' =\u003e 500,\n  ]);\n  \n  foreach ($epics as $epic) {\n    var_dump($epic);\n  }\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get epic info\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-agile-1-0-epic-epicIdOrKey-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\ntry {\n  $epic_service = new JiraRestApi\\Epic\\EpicService();\n  $epic_id = 1;\n  $epic = $epic_service-\u003egetEpic($epic_id);\n  \n  var_dump($epic);\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n#### Get epic issues\n[See Jira API reference](https://developer.atlassian.com/cloud/jira/software/rest/#api-agile-1-0-epic-epicIdOrKey-issue-get)\n\n```php\n\u003c?php\nrequire 'vendor/autoload.php';\n\ntry {\n  $epic_service = new JiraRestApi\\Epic\\EpicService();\n  $epic_id = 1;\n  $issues = $epic_service-\u003egetEpicIssues($epic_id, [\n    'maxResults' =\u003e 500,\n    'jql' =\u003e urlencode('status != Closed'),\n  ]);\n  \n  foreach ($issues as $issue) {\n    var_dump($issue);\n  }\n} catch (JiraRestApi\\JiraException $e) {\n    print('Error Occured! ' . $e-\u003egetMessage());\n}\n\n```\n\n# License\n\nApache V2 License\n\n# JIRA Rest API Documents\n* 6.4 - https://docs.atlassian.com/jira/REST/6.4/\n* Jira Server latest - https://docs.atlassian.com/jira/REST/server/\n* Jira Cloud latest - https://docs.atlassian.com/jira/REST/latest/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesstif%2Fphp-jira-rest-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flesstif%2Fphp-jira-rest-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flesstif%2Fphp-jira-rest-client/lists"}