404 errors when trying to use JIRA CLI

I am trying to link two issues using the JIRA CLI and getting a 404 error.

$ java -jar jira-cli-2.7.0.jar --server http://jira.SERVER.com --user USER_NAME --action linkIssue --issue "BUG-21" --toIssue "BUG-22" --comment "BUG-21 is a dupe of BUG-22" --password dummy --link "duplicate" -v -l < ~/.jirarc

Server address: http://jira.SERVER.com/rpc/soap/jirasoapservice-v2
URL
requested: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***
Request
type: POST
Content type: application/json
Post data: {"inwardIssue":{"key":"BUG-21"},"outwardIssue":{"key":"BUG-22"},"comment":{"body":"BUG-21 is a dupe of BUG-22"},"type":{"name":"duplicate"}}
Reading Key: JSESSIONID
Val: A6097AA50544439DD2E933A8105A9B1A
Reading Key: atlassian.xsrf.token
Val: BFVF-PDEY-UP44-H8X7|0e1c485abc8ef80d8894845ed7fc6af7fa449655|lout
Response code: 404, message: Not Found, url: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***
Problem
determination - response: 404: Not Found
Problem determination - response url: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***
Problem
determination - request url: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***

Remote
error: Resource does not exist. Use -v to see more details.
org.swift.common.cli.AbstractRemoteClient$RemoteResourceNotFoundException: Resource does not exist. Use -v to see more details.
at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:546)
at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:310)
at org.swift.jira.cli.JiraRealRestClient.linkIssue(JiraRealRestClient.java:319)
at org.swift.jira.cli.JiraClient.linkIssue(JiraClient.java:2269)
at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:589)
at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
at org.swift.common.cli.CliClient.doWork(CliClient.java:302)
at org.swift.jira.cli.JiraClient.main(JiraClient.java:158)

1 answer

You will get that error if one or more of the following conditions are true:

  1. *duplicate* isn't a defined link type - the name of the link type must match the case and length exactly
  2. *BUG-21* or *BUG-22* does not exist

Double check and if you still have a problem, open and issue

duplicate does exist and so do both of the issues.

I believe we had this discussion before. Is the problem the -l option. The user has to enter in the their password in the command line? If so, this is not an option for us. We would like to use the -l option to keep our passwords secure.

Ah, yes, you are correct. This action uses the REST APIs and you must provide a password for those. The login option only applies to SOAP requests :(.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,737 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you