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
requested: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***
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"}}
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=***
determination - response: 404: Not Found
Problem determination - response url: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***
determination - request url: http://jira.SERVER.com/rest/api/latest/issueLink?os_username=USER_NAME&os_password=***

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

64 views 0 5
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