Closed igittigitt closed 2 years ago
hi @igittigitt .
in accordance to the jira api document mentioned by you, JIRA just to return HTTP 201 status code when issue link create successfully.
so I think it's the correctly action to return NULL in this state.
thanks!
Hi @lesstif , thanks for answering. As you say, on success the REST API give back an HTTP 201, and if fail there will be a 40x or 50x. So it gives something back, what your code don't respect because it just always return NULL. So the caller never knows if the action took place or not. I would therefore strongly suggest to implement one of those options: 1.) throw an exception on an result other than 20x 2.) return TRUE of HTTP 20x, otherwise FALSE 3.) return what comes from the $this->exec an so give the caller the correct HTTP response
Hi @igittigitt, thanks for your detailed reply.
I'm on the same page, but sorry I can't have time for this modification.
could you make this PR, please?
thanks.
Thanks mate, i added a PR for it
I wondered why i always get NULL in return of calling addIssueLink($link) in my code. I've expected something JSON in return, as from the Jira API-Docs about issueLinks.
A quick look into the code (src/IssueLink/IssueLinkService.php) shows why. It's because the method
addIssueLink
just ends an do not return anything:I've simply added a "return" in front of the last line, which gives me a TRUE on success and an json-string on error. I'm shure this can be done better but it should be done :-)