In compact way, putting several field changes into a single API request. Your $Issue object will be applied to real JIRA issue until you call ->save(). \Badoo\Jira\Issue object accumulates changes for fields in internal properties. Look at Client and ClientRaw section of documentation to see how to configure instance of API client. This might be useful when you have several JIRA instances and want to work with them from single piece of code. If you want, you can instantiate another API client and provide it to \Badoo\Jira\Issue constructor. $ Issue = new \ Badoo\ Jira\ Issue( 'SMPL-1', $ Client) This is equivalent to: $ Client = \ Badoo\ Jira\ REST\ Client:: instance() $ Issue = new \ Badoo\ Jira\ Issue( 'SMPL-1') To get an issue object you can create it providing only an issue key. \Badoo\Jira\Issue class Getting \Badoo\Jira\Issue instances $ StagingIssue = new \ Badoo\ Jira\ Issue( 'SMPL-1', $ Staging) $ ProdIssue = new \ Badoo\ Jira\ Issue( 'SMPL-1', $ Prod) $ Staging-> setAuth( 'user', 'password/token') $ Staging = new \ Badoo\ Jira\ REST\ Client( '') $ Prod-> setAuth( 'user', 'password/token') Instances at the same time: $ Prod = new \ Badoo\ Jira\ REST\ Client( '') For example, if you want to work with your staging and production Several JIRA installations from one piece of code. The only reason we left the way to provide API client to all wrappers as a parameter is to enable you to interact with That is why we don't pass initialized JIRA API Client to all Issue, CustomField and other objects. NOTE: all following examples in documentation, related to any interaction with JIRA, consider you configured 'global'Ĭlient object. $response = $ Client-> getRawClient()-> get( '/method/you/wat/to/request', [ setJiraUrl( '') When you can't find something in structured client, you still can access Raw client inside it to do everything you need: $ Client = \ Badoo\ Jira\ REST\ Client:: instance() $ FieldInfo = $ Client-> field()-> get( 'summary') $ Client-> setAuth( 'user', 'password/token') You have also search through the response.īut with \Badoo\Jira\REST\Client you can do this $ Client = new \ Badoo\ Jira\ REST\ Client( '') You can't get info on particular field by its ID using only API. Some of sections also cache API responses and have special 'synthetic' methods for most common actions. Hint about available API methods and the options you can provide to each. The idea is free you from remembering URIs and HTTP request types for common actions. issue, /field, /project and so on.Įach section has bindings to the most popular API methods with parameters it accepts. It is split into several sections, one for each prefix of API methods: e.g. Print_r( $fields) Structured client \Badoo\Jira\REST\Client $ RawClient-> setAuth( 'user', 'token/password') $ RawClient = new \ Badoo\ Jira\ REST\ ClientRaw( '') (GET, POST, etc.) and what parameters to send.Ĭonsider ClientRaw as a smart wrapper for PHP curl. That's all, it has no other complex logic inside: you decide what URI to request, which type of HTTP request to send Throws an \Badoo\Jira\REST\Exception for API errors or parsed response data when everything went OK. The client to JIRA API is split into two parts: The simplest interface to API: \Badoo\Jira\REST\ClientRaw Read Configure the client section above to know how to do that. NOTE: all examples in this documentation related to any interaction with JIRA consider you configured 'global' $ Issue-> save() Delete the issue $ Issue = new \ Badoo\ Jira\ Issue( 'SMPL-1') > setDescription( 'Yor new description for issue') ) Get the issue $ Issue = new \ Badoo\ Jira\ Issue( 'SMPL-1') 'description' => $ Issue-> getDescription(), > setDescription( 'description of issue created by Badoo JIRA PHP client') > setAuth( 'user', 'token/password') Create new issue $ Request = new \ Badoo\ Jira\ Issue\ CreateRequest( 'SMPL', 'Task') Quick start Install composer require badoo/jira-client Initialize the client $ Jira = \ Badoo\ Jira\ REST\ Client:: instance() You can also generate lots of classes for custom fields to get the documentation for your own JIRA installation This makes code easier to write because of autocompletion your IDE will provide you. It contains a bunch of wrapper classes for most common API objects: To install the bindings via Composer, add the following to composer.This is Badoo JIRA REST Client. PHP 5.5 and later Installation & Usage Composer This PHP package is automatically generated by the OpenAPI Generator project: This is the jira rest resources endpoint documentation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |