go-jira / jira

simple jira command line client in Go
Apache License 2.0
2.66k stars 323 forks source link

Feature request: Delete issue link #484

Open darthwalsh opened 1 year ago

darthwalsh commented 1 year ago

A great feature would be the ability to use the Jira API to delete links.

Background

I can run jira issuelink ABC-384 Blocks ABC-401 now, but looking at issue.go I don't see a way to undo it.

The jira v2 API to delete links is to send a DELETE to URL /rest/api/2/issueLink/{linkId} (and the v3 API is the same).

Proposed design

Passing the linkid to the CLI seems tedious, so a command like jira issuelink --rm ABC-384 Blocks ABC-401 would be more usable.

Maybe the CLI would first query OUTWARDISSUE and/or INWARDISSUE, loop through the existing links, and remove any links matching the inward/outward direction specified?

If no links exist to remove, it would be treat the deletion as idempotent, and succeed anyways. This seems to be what jira issuelink does when the link already exists. Printing a warning message could be helpful, though (i.e. if the link only existed in the other direction)