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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,175 views 13 19
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot