You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems as if there was no method in the JIRA class to remove remotelinks (by globalId or internalId) from issues.
Is this in purpose/has there not been any demand for this, yet?
importurllib.parse@translate_resource_argsdefdelete_remotelink(self, issue: Union[str, Issue], *, internalid: Optional[str] =None, globalid: Optional[str] =None) ->Response:
"""Delete remotelink from issue by internalId or globalId. Args: issue (str): Key (or Issue) of Issue internalid (str): InternalID of the remotelink to delete globalid (str): GlobalID of the remotelink to delete Returns: Response """ifnot ((internalidisNone) ^ (globalidisNone)):
raiseValueError("Must supply either 'internalid' XOR 'globalid'.")
ifinternalidisnotNone:
url=self._get_url("issue/"+str(issue) +"/remotelink/"+str(internalid))
elifglobalidisnotNone:
# stop "&" and other special characters in globalid from messing around with the queryglobalid=urllib.parse.quote(globalid, safe="")
url=self._get_url("issue/"+str(issue) +"/remotelink?globalId="+globalid)
returnself._session.delete(url)
Alternatives
Splitting the above method into 2 (One for globalId one for internalId)
(also see the test case I've linked at the bottom of this message)
Now at the global ID level, I do not believe this exists.
It would be great if you are able to submit a pull request for your proposal, it looks good to me as a single method, some suggestions from me:
--internalid++internal_id
--globalid++global_id
Would also be great if you can use the "f-string" format, we have this running on our linter tox -e lint so it should just be applied for you, e.g. self._get_url(f"issue/{issue}/remotelink?globalId={globalid}")
and it would be great if you can write a test case for this, perhaps very similar to this:
I will have to wait until I've had my employer's FOSS-workshop. Don't want to be in a pickle in the end. I will start working on this in approx. 1,5 months. If anyone else is craving this, feel free.
Problem trying to solve
It seems as if there was no method in the JIRA class to remove remotelinks (by globalId or internalId) from issues.
Is this in purpose/has there not been any demand for this, yet?
Possible solution(s)
Implement the DELETE remotelink routes (As described here:
https://docs.atlassian.com/software/jira/docs/api/REST/8.13.14/#issue-deleteRemoteIssueLinkByGlobalId
https://docs.atlassian.com/software/jira/docs/api/REST/8.13.14/#issue-deleteRemoteIssueLinkById
https://developer.atlassian.com/server/jira/platform/jira-rest-api-for-remote-issue-links/#deleting-a-remote-link-by-global-id )
Alternatives
Splitting the above method into 2 (One for globalId one for internalId)
Additional Context
Pull request wanted?
Jannik Meinecke ([email protected]) on behalf of MBition GmbH.
Provider Information
The text was updated successfully, but these errors were encountered: