oRastor / jira-client

A simple PHP JIRA REST client
MIT License
20 stars 18 forks source link

Support for creating remote (web) links #15

Open Programie opened 7 years ago

Programie commented 7 years ago

As far as I can see it is not possible to create remote links with this API client, right?

The following JSON posted to "/rest/api/latest/issue/${ISSUE}/remotelink" would create a remote link (Web Link):

{
    "object": {
        "url": "https://github.com/oRastor/jira-client",
        "title" : "Title of the link"
    }
}

See https://community.atlassian.com/t5/Answers-Developer-Questions/Create-hyperlink-in-Jira-issue-via-REST-API/qaq-p/552251#M89911

oRastor commented 7 years ago

Currently this feature is not supported

Programie commented 7 years ago

You mean, it is not supported by the current JIRA API?

The JIRA API documentation says, that it is supported in JIRA 5.0 or later: https://developer.atlassian.com/jiradev/jira-platform/guides/other/guide-jira-remote-issue-links/jira-rest-api-for-remote-issue-links

oRastor commented 7 years ago

I mean, that this library do not support such resources as remote link. Not all requests and not all resources implemented for now.

Requests that not implemented in library can be processed with JiraClient\JiraClient like this:

$response = $client->callPost("/rest/api/latest/issue/{$issueId}/remotelink", [
    'object' => [
        "url" => "https://github.com/oRastor/jira-client",
        "title" => "Title of the link"
    ]
]);

Maybe later I will make this feature.

Programie commented 7 years ago

OK, that will already help me. Thanks anyway. 🙂