Closed shudder closed 8 years ago
Are you talking about configurable API prefix? Right now we have /rest/api/2/
hardcoded in all API calls. The article you've mentioned talks about /rest/agile/1.0
and /rest/servicedeskapi/
prefixes.
If you're not mixing regular API calls with service desk ones, then setting a prefix once during initialization of an API client can be sufficient, but that in turn would break all existing calls, that expect /rest/api/2/
prefix.
Any specific idea how you want this to be implemented?
Well, making the prefix configurable on API client initialization would be sufficient for me specifically since I don't plan to mix /rest/servicedeskapi/
and /rest/api/2/
.
I don't really know whether this would make sense either since a Service Desk user should not have the privileges to access /rest/api/2/
and a regular JIRA user should not need to access /rest/servicedeskapi/
since all information should be available from /rest/api/2/
as well.
Not sure if I'm missing something, but this is how I would use it.
Maybe you're more interested in adding nice wrapper methods (e.g. getRoleDetails
) for Service Desk API calls instead? If that is ok, then you can send a PR with methods you need (no need to create all methods possible).
Looking closely at Service Desk API document at https://docs.atlassian.com/jira-servicedesk/REST/latest/ I've found, that all API calls in there are marked as Experimental
, which means, that:
X-ExperimentalApi : true
to be passed in headers to use themMaybe instead:
$experimental = false
parameter to the CurlClient
and PHPClient
classes$experimental
parameter as class propertysendRequest
methods of above classes and experimental
property is thrusy, then add X-ExperimentalApi : true
headerWhen above is implemented (you can send a PR) then following construct will be possible:
$api = new \chobie\Jira\Api(
"https://your-jira-project.net",
new \chobie\Jira\Api\Authentication\Basic("yourname", "password"),
new \chobie\Jira\Api\Client\CurlClient(true)
);
$result = $api->api(\chobie\Jira\Api::REQUEST_GET, '/rest/servicedeskapi/info');
As I'm not really sure whether or not some wrapper methods will work, let me just tell you what I'm up to. Basically, the plan is to replace the current JIRA Service Desk UI. I just don't like the way Atlassian done it and certain people doesn't either, even though the Service Desk functionalities are quite good. I'm going to have a closer look at the documentation. Thanks for your input.
Good. Send PR, when you're ready.
I am also looking for this integration so I don't have to start over or fork the project to replace the hardcoded URLs.
Sure @gmask . If you have any ideas on how to make it usable, then please share.
I am also looking for this integration so I don't have to start over or fork the project to replace the hardcoded URLs.
@gmask , the URL prefix is only hardcoded in Api
class methods (e.g. updateVersion
), that make API calls. The Api::api
method isn't hardcoding anything so you can use it already.
@shudder , any update on PR?
Closing due no activity for 2 months. Feel free to reopen if needed.
Atlassian recently added API support for JIRA Service Desk. Would be great to have this covered.
https://developer.atlassian.com/blog/2016/01/new-JIRA-Service-Desk-and-JIRA-Software-REST-APIs/