404 errors when trying to use JIRA CLI

buildmonkey September 9, 2012

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

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2012

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

buildmonkey September 9, 2012

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.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 9, 2012

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