How to add remote links to Jira issues using Jira Command Line Interface (CLI)

Jira allows adding remote links to issues through the Link option in User Interface (UI). This article explains how to add the same remote links to Jira issues, using Jira Command Line Interface (CLI).

Instructions

The addRemoteLink action allows adding other Jira issue links or Confluence page links or other web links to a Jira issue.

Add other Jira issue link from the same instance

Use the below mentioned action command to add another issue link to a Jira issue from the same instance:

--action addRemoteLink --issue "COT-7" --name "Jira issue 7" --url "http://jirasso.bobfire.com:8284/browse/TEST1-2"

The parameter name is used to specify a label for the link. In this example action, a link is added to the TEST1-2 issue under the Issue links section in the Jira issue: COT-7 with label: Jira Issue 7.

Add other Jira issue link of a different instance

Make use of the parameters targetServer, targetUser and targetPassword for CLI to connect to the other instance and add the issue link. Refer to the example action command mentioned below:

--action addRemoteLink --issue "COT-7" --name "Issue 1" --link "My jira issue link"  --url "http://jirasso.bobfire.com:8249/browse/PER-1" --targetServer "http://jirasso.bobfire.com:8249/" --targetUser "xxx" --targetPassword "xxx"

In this example, the parameter link is used as a label instead of the default Jira label links to for the link. The parameter 'name' is used as a label to the hyperlink. 

Refer to the screenshot below that shows the output:

Add Confluence page URL to a Jira issue 

Use the below mentioned action command to add the Confluence page URL to the Jira issue:

--action addRemoteLink --issue "COT-7" --name "Confluence Page" --link "confluence link"  --url "http://jirasso.bobfire.com:8143/display/SSCO/test+page" --targetServer "http://jirasso.bobfire.com:8143/" --targetUser "xxxx" --targetPassword "xxx"

The Confluence page link is added to the issue as mentioned below:

Add web links to a Jira issue

Use the below mentioned action command to add the web page URL to the Jira issue:

--action addRemoteLink --issue "COT-7" --name "Confluence Page" --link "confluence link"  --url "https://www.google.com/"

The weblink is added to the issue as mentioned below:

It is recommended to test these in a non-production environment or run the actions with the --simulate parameter to verify the behavior before deploying on a production environment.