Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Add service desk API #1

Merged
merged 38 commits into from
Apr 30, 2021
Merged

Add service desk API #1

merged 38 commits into from
Apr 30, 2021

Conversation

AlexP11223
Copy link
Collaborator

@AlexP11223 AlexP11223 commented Jan 29, 2021

Implements the Service Desk API needed for PROD-77.

I tried to keep this in similar style as the rest of the lib, while trying to do it better and more SOLID. So the API requests are grouped in <API-Group>Service classes inheriting JiraClient like the rest of the lib. Most of the entities in this part have interfaces, which e.g. don't include setters needed only for JSON mapping.

For paged queries there is Pagination similar to idealo SDK. It uses PhpStan/psalm @template generics for results. Sadly it is not supported in PhpStorm yet, so no autocompletion, etc.

The tests are mostly e2e, so they require our test Jira. Can be run via vendor/bin/phpunit tests/ServiceDesk, connection config is in .env and some config for tests (project id, ...) is in .env.phpunit. Non-e2e tests (pagination, ...) are run by CI.

Getting customer requests: not implemented because SD API cannot filter requests for the specified customer, need to use JQL from the standard API, already implemented.

Attachments: I implemented the attachment-related SD API, but looks like it is useless for our purposes because it does not allow to attach on behalf of another user, even if passing to attachment field when creating a request. 😂 The standard issue API seems to work.

One problem with this lib is that it uses Curl directly instead of PSR-18. :( There was an issue about this, possibly with some work in progress.

And also it looks like there is no easy way in Curl to upload files from a stream without a real file in fs, except building the multipart stuff manually like here. So currently we would have to create tmp files for attachments.

@AlexP11223 AlexP11223 force-pushed the feature/service-desk branch from 40a484f to 9d35d60 Compare January 29, 2021 16:32
@AlexP11223 AlexP11223 marked this pull request as draft January 29, 2021 16:33
@AlexP11223 AlexP11223 force-pushed the feature/service-desk branch from 56438ba to ea02907 Compare February 1, 2021 15:51
@AlexP11223 AlexP11223 force-pushed the feature/service-desk branch from ea02907 to 9ccb8ec Compare February 1, 2021 17:14
@AlexP11223 AlexP11223 force-pushed the feature/service-desk branch from fdeb1fb to dd61c75 Compare February 2, 2021 20:46
@AlexP11223 AlexP11223 marked this pull request as ready for review February 3, 2021 11:39
@XedinUnknown XedinUnknown self-assigned this Mar 3, 2021
@XedinUnknown XedinUnknown added the enhancement New feature or request label Mar 3, 2021
Copy link

@XedinUnknown XedinUnknown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, excellent work, and a superb addition to the original package!

src/Pagination/IterablePaginationInterface.php Outdated Show resolved Hide resolved
src/ServiceDesk/CustomerService.php Outdated Show resolved Hide resolved
src/ServiceDesk/Attachment/Attachment.php Show resolved Hide resolved
src/ServiceDesk/RequestService.php Outdated Show resolved Hide resolved
src/ServiceDesk/RequestService.php Show resolved Hide resolved
src/ServiceDesk/RequestService.php Outdated Show resolved Hide resolved
src/ServiceDesk/RequestService.php Outdated Show resolved Hide resolved
src/ServiceDesk/RequestService.php Outdated Show resolved Hide resolved
@AlexP11223 AlexP11223 requested a review from XedinUnknown March 19, 2021 15:34
src/JsonOperationsTrait.php Show resolved Hide resolved
src/ServiceDesk/CustomerService.php Outdated Show resolved Hide resolved
@AlexP11223 AlexP11223 force-pushed the feature/service-desk branch from 8adb069 to 28d54da Compare March 30, 2021 15:33
@AlexP11223 AlexP11223 requested a review from XedinUnknown March 30, 2021 15:41
@AlexP11223 AlexP11223 merged commit 3c0e487 into inpsyde-develop Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants