How to use linkIssue


linkIssue is one of the more problematic actions in the JCLI. This is partly due to the lack of a good API on earlier Jira versions and some release specific differences in the new REST API behavior on later Jira releases. The changes forced incompatibilities in use scenarios. On the latest Jira releases (5.0 and above), it seems that things have stabilized. Another difficulty is that the error messaging is poor. This means that it is often hard to figure out what is actually wrong with the request. As the Jira REST APIs improve over time, it is hoped this problem can be decreased. You should be using a recent version of Jira CLI to cover fixes that have been made in this area (3.0 or above).

Information for Jira 5.x and above

There are some linkIssue examples here. This is the basic:

jira --action linkIssue --issue ZLINKS-1 --toIssue ZLINKS-2 --link "Relates"

  1. The issue and toIssue actions must exist and be authorized for access. For instance: 

    jira --action getIssue --issue ZLINKS-1
  2. The link value must match exactly (case sensitive, blank sensitive) with the defined entry name.
    • A simple way to check what is available is to run the following: 

      jira --action getLinkTypeList
      5 issue link types.
      "10100","Blocks","is blocked by","blocks"
      "10000","Bonfire Testing","discovered while testing","testing discovered"
      "10101","Cloners","clone of","was cloned to"
      "10102","Duplicate","is duplicated by","duplicates"
      "10103","Relates","relates to","relates to"
  3. If you still have a problem, open an issue. Please provide:
    1. Command and output with --debug
    2. Output from getIssue for each issue
    3. Output from getLinkTypeList