org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.

JIRA | Jesse Guertin | 1 year ago
  1. 0

    I am trying to use version 4.5 of the JIRA Command Line Interface (CLI), but I get a 401 response on any request (see example below). -- The server address appears to be a deprecated SOAP service: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action getServerInfo --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 401, message: Unauthorized, url: https://middil.atlassian.net/rest/api/latest/serverInfo? Remote error: User is not authorized to perform the request. Response code: 401. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401. at org.swift.common.cli.AbstractRestClient.handleBadResponseCode(AbstractRestClient.java:722) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:692) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489) at org.swift.jira.cli.JiraRestClient.getServerInfo(JiraRestClient.java:1835) at org.swift.jira.cli.JiraClient.getServerInfoAlternate(JiraClient.java:1856) at org.swift.jira.cli.JiraClient.getRemoteServerInfo(JiraClient.java:1829) at org.swift.jira.cli.JiraClient.validateJiraRelease(JiraClient.java:1978) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:710) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153) {code} -- Here are my customizations of atlassian.sh (with password obfuscated): {code} # - - - - - - - - - - - - - - - - - - - - START CUSTOMIZE FOR YOUR INSTALLATION !!! user='jessegue' password='********' settings='' if [ "$application" = "all" ]; then string="all-cli-4.5.0.jar" elif [ "$application" = "confluence" ]; then string="confluence-cli-4.5.0.jar --server https://confluence.example.com --user $user --password $password" elif [ "$application" = "jira" ]; then string="jira-cli-4.5.0.jar --server https://middil.atlassian.net --user $user --password $password" elif [ "$application" = "fisheye" ]; then string="fisheye-cli-4.5.0.jar --server https://fisheye.example.com --user $user --password $password" elif [ "$application" = "crucible" ]; then string="crucible-cli-4.5.0.jar --server https://crucible.example.com --user $user --password $password" elif [ "$application" = "bamboo" ]; then string="bamboo-cli-4.5.0.jar --server https://bamboo.example.com --user $user --password $password" elif [ "$application" = "stash" ]; then string="stash-cli-4.5.0.jar --server https://stash.example.com --user $user --password $password" elif [ "$application" = "hipchat" ]; then string="hipchat-cli-${hipchatVersion}.jar --server https://hipchat.example.com --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # - - - - - - - - - - - - - - - - - - - - - END CUSTOMIZE FOR YOUR INSTALLATION !!! {code} -- I am able to confirm my user credentials using CURL and the REST API: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ curl --basic -u jguertin https://middil.atlassian.net/rest/api/latest/serverInfo? Enter host password for user 'jguertin': {"baseUrl":"https://middil.atlassian.net","version":"7.0.0-OD-08-005","versionNumbers":[7,0,0],"buildNumber":70107,"buildDate":"2015-10-28T00:00:00.000-0400","serverTime":"2015-11-03T13:26:21.766-0500","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTitle":"JIRA"} {code} -- The CLI Connector is installed on our JIRA Cloud (OnDemand) instance at https://middil.atlassian.net/, and I am using [version 4.5|https://bobswift.atlassian.net/wiki/download/attachments/16285777/atlassian-cli-4.5.0-distribution.zip?version=1&modificationDate=1442443925818&api=v2] of the CLI Client. {noformat} CLI Connector - installed on the server using UPM. You have already completed this step! CLI Client - installed separately on any system (Windows, Linux, OSX) that has Java 7 or higher. {noformat} -- Please let me know what additional information may be helpful. Thank you!

    JIRA | 1 year ago | Jesse Guertin
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.
  2. 0

    I am trying to use version 4.5 of the JIRA Command Line Interface (CLI), but I get a 401 response on any request (see example below). -- The server address appears to be a deprecated SOAP service: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action getServerInfo --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 401, message: Unauthorized, url: https://middil.atlassian.net/rest/api/latest/serverInfo? Remote error: User is not authorized to perform the request. Response code: 401. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401. at org.swift.common.cli.AbstractRestClient.handleBadResponseCode(AbstractRestClient.java:722) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:692) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489) at org.swift.jira.cli.JiraRestClient.getServerInfo(JiraRestClient.java:1835) at org.swift.jira.cli.JiraClient.getServerInfoAlternate(JiraClient.java:1856) at org.swift.jira.cli.JiraClient.getRemoteServerInfo(JiraClient.java:1829) at org.swift.jira.cli.JiraClient.validateJiraRelease(JiraClient.java:1978) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:710) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153) {code} -- Here are my customizations of atlassian.sh (with password obfuscated): {code} # - - - - - - - - - - - - - - - - - - - - START CUSTOMIZE FOR YOUR INSTALLATION !!! user='jessegue' password='********' settings='' if [ "$application" = "all" ]; then string="all-cli-4.5.0.jar" elif [ "$application" = "confluence" ]; then string="confluence-cli-4.5.0.jar --server https://confluence.example.com --user $user --password $password" elif [ "$application" = "jira" ]; then string="jira-cli-4.5.0.jar --server https://middil.atlassian.net --user $user --password $password" elif [ "$application" = "fisheye" ]; then string="fisheye-cli-4.5.0.jar --server https://fisheye.example.com --user $user --password $password" elif [ "$application" = "crucible" ]; then string="crucible-cli-4.5.0.jar --server https://crucible.example.com --user $user --password $password" elif [ "$application" = "bamboo" ]; then string="bamboo-cli-4.5.0.jar --server https://bamboo.example.com --user $user --password $password" elif [ "$application" = "stash" ]; then string="stash-cli-4.5.0.jar --server https://stash.example.com --user $user --password $password" elif [ "$application" = "hipchat" ]; then string="hipchat-cli-${hipchatVersion}.jar --server https://hipchat.example.com --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # - - - - - - - - - - - - - - - - - - - - - END CUSTOMIZE FOR YOUR INSTALLATION !!! {code} -- I am able to confirm my user credentials using CURL and the REST API: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ curl --basic -u jguertin https://middil.atlassian.net/rest/api/latest/serverInfo? Enter host password for user 'jguertin': {"baseUrl":"https://middil.atlassian.net","version":"7.0.0-OD-08-005","versionNumbers":[7,0,0],"buildNumber":70107,"buildDate":"2015-10-28T00:00:00.000-0400","serverTime":"2015-11-03T13:26:21.766-0500","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTitle":"JIRA"} {code} -- The CLI Connector is installed on our JIRA Cloud (OnDemand) instance at https://middil.atlassian.net/, and I am using [version 4.5|https://bobswift.atlassian.net/wiki/download/attachments/16285777/atlassian-cli-4.5.0-distribution.zip?version=1&modificationDate=1442443925818&api=v2] of the CLI Client. {noformat} CLI Connector - installed on the server using UPM. You have already completed this step! CLI Client - installed separately on any system (Windows, Linux, OSX) that has Java 7 or higher. {noformat} -- Please let me know what additional information may be helpful. Thank you!

    JIRA | 1 year ago | Jesse Guertin
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.
  3. 0

    Using actions from the [examples page|https://bobswift.atlassian.net/wiki/display/JCLI/Examples], I get a 400 Response using either the *cloneIssue* or *cloneIssues* action (see examples below). This issue may be related to [JCLI-746|https://bobswift.atlassian.net/browse/JCLI-746], but I was unable to find any details in that ticket. I can successfully perform other actions, like addComment (see example at bottom), but issue cloning is the reason we are trying this add-on. Below are some abbreviated examples of output from cloneIssue and cloneIssues actions. Please let me know if you need more information. - cloneIssue: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action cloneIssue --issue "CPW-82" --summary "Test CPW-82 Clone" --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/serverInfo? json: {"baseUrl":"https:\/\/middil.atlassian.net","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTime":"2015-11-06T08:29:56.304-0500","buildDate":"2015-10-28T00:00:00.000-0400","serverTitle":"JIRA","version":"7.0.0-OD-08-005","buildNumber":70107,"versionNumbers":[7,0,0]} check JIRA release: 7.0.0-OD-08-005 URL requested: https://middil.atlassian.net/rest/api/latest/field? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/field? URL requested: https://middil.atlassian.net/rest/api/latest/issue/CPW-82?&fields=*all%2C-comment%2C-worklog Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/issue/CPW-82?&fields=*all%2C-comment%2C-worklog Id . . . . . . . . . . . . . : issuetype Name . . . . . . . . . . . . : Issue Type Description . . . . . . . . . : Required . . . . . . . . . . : false Has default . . . . . . . . . : false Has allowed values . . . . . : false Type . . . . . . . . . . . . : issuetype Item type . . . . . . . . . . : URL requested: https://middil.atlassian.net/rest/api/latest/project/CPW? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/project/CPW? URL requested: https://middil.atlassian.net/rest/api/latest/issue/createmeta/?&expand=projects.issuetypes.fields&projectKeys=CPW&issuetypeIds=3 Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/issue/createmeta/?&expand=projects.issuetypes.fields&projectKeys=CPW&issuetypeIds=3 Id . . . . . . . . . . . . . : project Name . . . . . . . . . . . . : Project Description . . . . . . . . . : Required . . . . . . . . . . : true Has default . . . . . . . . . : false Has allowed values . . . . . : true Type . . . . . . . . . . . . : project Item type . . . . . . . . . . : ... URL requested: https://middil.atlassian.net/rest/api/latest/issue? Request type: POST Content type: application/json Post data: {"fields":{"summary":"Test CPW-82 Clone","issuetype":{"id":"3"},"components":[],"project":{"id":"11800"},"description":"","reporter":{"name":"jguertin"},"customfield_11100":"Yes","priority":{"id":"3"},"labels":[],"customfield_10008":"","customfield_10902":"","duedate":null,"customfield_10903":"","customfield_10904":"","issuelinks":[],"assignee":{"name":null}}} Response code: 400, message: Bad Request, url: https://middil.atlassian.net/rest/api/latest/issue? json: {"errorMessages":[],"errors":{"issuelinks":"Field does not support update 'issuelinks'"}} Remote error: issuelinks: Field does not support update 'issuelinks' org.swift.common.cli.AbstractRemoteClient$RemoteRestException: issuelinks: Field does not support update 'issuelinks' at org.swift.common.cli.AbstractRestClient.printErrorMessages(AbstractRestClient.java:291) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:690) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489) at org.swift.jira.cli.JiraRestClient.createIssue(JiraRestClient.java:2054) at org.swift.jira.cli.helpers.IssueHelper.createIssue(IssueHelper.java:157) at org.swift.jira.cli.helpers.CloneIssueHelper.cloneIssue(CloneIssueHelper.java:384) at org.swift.jira.cli.helpers.CloneIssueHelper.cloneIssueRest(CloneIssueHelper.java:328) at org.swift.jira.cli.helpers.CloneIssueHelper.cloneIssue(CloneIssueHelper.java:310) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:934) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153) {code} - cloneIssues: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action cloneIssues --project "CPW" --search "project = CPW AND issuekey = CPW-82" --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/serverInfo? json: {"baseUrl":"https:\/\/middil.atlassian.net","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTime":"2015-11-06T08:48:10.671-0500","buildDate":"2015-10-28T00:00:00.000-0400","serverTitle":"JIRA","version":"7.0.0-OD-08-005","buildNumber":70107,"versionNumbers":[7,0,0]} check JIRA release: 7.0.0-OD-08-005 Search: project = CPW AND issuekey = CPW-82 URL requested: https://middil.atlassian.net/rest/api/latest/project/CPW? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/project/CPW? URL requested: https://middil.atlassian.net/rest/api/latest/search? Request type: POST Content type: application/json Post data: {"jql":"project = CPW AND issuekey = CPW-82","maxResults":50,"fields":["*all","-comment","-worklog"],"startAt":0} Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/search? URL requested: https://middil.atlassian.net/rest/api/latest/field? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/field? URL requested: https://middil.atlassian.net/rest/api/latest/issue/CPW-82?&fields=*all%2C-comment%2C-worklog Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/issue/CPW-82?&fields=*all%2C-comment%2C-worklog Id . . . . . . . . . . . . . : issuetype Name . . . . . . . . . . . . : Issue Type Description . . . . . . . . . : Required . . . . . . . . . . : false Has default . . . . . . . . . : false Has allowed values . . . . . : false Type . . . . . . . . . . . . : issuetype Item type . . . . . . . . . . : ... URL requested: https://middil.atlassian.net/rest/api/latest/issue? Request type: POST Content type: application/json Post data: {"fields":{"summary":"Test Task Ticket","issuetype":{"id":"3"},"components":[],"project":{"id":"11800"},"description":"","reporter":{"name":"jguertin"},"customfield_11100":"Yes","priority":{"id":"3"},"labels":[],"customfield_10008":"","customfield_10902":"","duedate":null,"customfield_10903":"","customfield_10904":"","issuelinks":[],"assignee":{"name":null}}} Response code: 400, message: Bad Request, url: https://middil.atlassian.net/rest/api/latest/issue? json: {"errorMessages":[],"errors":{"issuelinks":"Field does not support update 'issuelinks'"}} issuelinks: Field does not support update 'issuelinks' Clone of issue CPW-82 failed. Client error: 1 issues failed to be cloned. 0 issues cloned to project CPW. org.swift.common.cli.CliClient$ClientException: 1 issues failed to be cloned. 0 issues cloned to project CPW. at org.swift.jira.cli.helpers.CloneIssueHelper.cloneIssues(CloneIssueHelper.java:480) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:937) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153) {code} - addComment: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action addComment --issue "CPW-82" --comment "Test Comment #2 @ 8:36am" --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/serverInfo? json: {"baseUrl":"https:\/\/middil.atlassian.net","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTime":"2015-11-06T08:35:59.328-0500","buildDate":"2015-10-28T00:00:00.000-0400","serverTitle":"JIRA","version":"7.0.0-OD-08-005","buildNumber":70107,"versionNumbers":[7,0,0]} check JIRA release: 7.0.0-OD-08-005 URL requested: https://middil.atlassian.net/rest/api/latest/issue/CPW-82?&fields=*all%2C-comment%2C-worklog Request type: GET Content type: application/json Response code: 200, message: OK, url: https://middil.atlassian.net/rest/api/latest/issue/CPW-82?&fields=*all%2C-comment%2C-worklog URL requested: https://middil.atlassian.net/rest/api/latest/issue/CPW-82/comment? Request type: POST Content type: application/json Post data: {"body":"Test Comment #2 @ 8:36am"} Response code: 201, message: Created, url: https://middil.atlassian.net/rest/api/latest/issue/CPW-82/comment? Comment added to CPW-82. {code}

    JIRA | 1 year ago | Jesse Guertin
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: issuelinks: Field does not support update 'issuelinks'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Z:\5.0 CLI>jira --verbose --server https://XXXX.atlassian.net --user XXXX --password XXXX --action createProject --project "mdtest2" --name "MD Test 2" --lea d "Mike.Doherty" --defaultAssignee "mike.doherty" Server address: https://unipro.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://unipro.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 200, message: OK, url: https://unipro.atlassian.net/rest/api/latest/serverInfo? json: {"baseUrl":"https:\/\/unipro.atlassian.net","scmInfo":"3f098e887822d12897dbfd77339d1bc8b3ef240b","serverTime":"2015-10-19T12:47:52.547+0100","buildDate":" 2015-10-14T00:00:00.000+0100","serverTitle":"JIRA","version":"7.0.0-OD-08-002","buildNumber":70107,"versionNumbers":[7,0,0]} check JIRA release: 7.0.0-OD-08-002 URL requested: https://unipro.atlassian.net/rest/api/latest/user?&expand=groups&username=Mike.Doherty Request type: GET Content type: application/json Response code: 200, message: OK, url: https://unipro.atlassian.net/rest/api/latest/user?&expand=groups&username=Mike.Doherty json: {"emailAddress":"mike.doherty@theuniprogroup.com","expand":"groups,applicationRoles","avatarUrls":{"48x48":"https:\/\/unipro.atlassian.net\/secure\/userav atar?ownerId=mike+doherty&avatarId=15501","24x24":"https:\/\/unipro.atlassian.net\/secure\/useravatar?size=small&ownerId=mike+doherty&avatarId=15501","16x16":"h ttps:\/\/unipro.atlassian.net\/secure\/useravatar?size=xsmall&ownerId=mike+doherty&avatarId=15501","32x32":"https:\/\/unipro.atlassian.net\/secure\/useravatar?s ize=medium&ownerId=mike+doherty&avatarId=15501"},"displayName":"Mike Doherty","name":"mike.doherty","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/user?u sername=mike.doherty","active":true,"timeZone":"Europe\/Dublin","groups":{"size":15,"items":[{"name":"C-Level Manager","self":"https:\/\/unipro.atlassian.net\/r est\/api\/2\/group?groupname=C-Level+Manager"},{"name":"CGI QA","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=CGI+QA"},{"name":"Project Managers","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=Project+Managers"},{"name":"Specsavers Dev Team","self":"https:\/\/unipro.atlass ian.net\/rest\/api\/2\/group?groupname=Specsavers+Dev+Team"},{"name":"Tempo Account Managers","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupn ame=Tempo+Account+Managers"},{"name":"Time Sheet Managers","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=Time+Sheet+Managers"},{"name":" Unipro Intranet","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=Unipro+Intranet"},{"name":"Unipro Programme Management","self":"https:\/\ /unipro.atlassian.net\/rest\/api\/2\/group?groupname=Unipro+Programme+Management"},{"name":"administrators","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2 \/group?groupname=administrators"},{"name":"confluence-users","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=confluence-users"},{"name":" jira-servicedesk-users","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=jira-servicedesk-users"},{"name":"jira-users","self":"https:\/\/un ipro.atlassian.net\/rest\/api\/2\/group?groupname=jira-users"},{"name":"service-desk-agents","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupna me=service-desk-agents"},{"name":"site-admins","self":"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=site-admins"},{"name":"unipro-users","self" :"https:\/\/unipro.atlassian.net\/rest\/api\/2\/group?groupname=unipro-users"}]},"locale":"en_UK","key":"mike doherty","applicationRoles":{"size":2,"items":[]}} URL requested: https://unipro.atlassian.net/rest/project-templates/1.0/templates?os_username=cli&os_password=*** Request type: GET Content type: application/x-www-form-urlencoded Response code: 200, message: OK, url: https://unipro.atlassian.net/rest/project-templates/1.0/templates?os_username=cli&os_password=*** Project template list: [[name: Scrum software development, projectTemplateModuleCompleteKey: com.pyxis.greenhopper.jira:gh-scrum-template, itemModuleCompleteKey : com.pyxis.greenhopper.jira:gh-scrum-template, allowCreateProject: true], [name: Kanban software development, projectTemplateModuleCompleteKey: com.pyxis.green hopper.jira:gh-kanban-template, itemModuleCompleteKey: com.pyxis.greenhopper.jira:gh-kanban-template, allowCreateProject: true], [name: Basic software developme nt, projectTemplateModuleCompleteKey: com.pyxis.greenhopper.jira:basic-software-development-template, itemModuleCompleteKey: com.pyxis.greenhopper.jira:basic-so ftware-development-template, allowCreateProject: true], [name: Basic Service Desk, projectTemplateModuleCompleteKey: com.atlassian.servicedesk:classic-service-d esk-project, itemModuleCompleteKey: com.atlassian.servicedesk:classic-service-desk-project, allowCreateProject: true], [name: IT Service Desk, projectTemplateMo duleCompleteKey: com.atlassian.servicedesk:itil-service-desk-project, itemModuleCompleteKey: com.atlassian.servicedesk:itil-service-desk-project, allowCreatePro ject: true], [name: Task management, projectTemplateModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-task-management, itemModuleCompleteKe y: com.atlassian.jira-core-project-templates:jira-core-task-management, allowCreateProject: true], [name: Project management, projectTemplateModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-project-management, itemModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-project-manag ement, allowCreateProject: true], [name: Process management, projectTemplateModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-process-manag ement, itemModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-process-management, allowCreateProject: true]] URL requested: https://unipro.atlassian.net/rest/api/latest/project? Request type: POST Content type: application/json Post data: {"projectTemplateKey":"com.pyxis.greenhopper.jira:basic-software-development-template","name":"MD Test 2","description":"","assigneeType":"MIKE.DOHER TY","projectTypeKey":"software","key":"MDTEST2","lead":"Mike.Doherty","url":""} Response code: 400, message: Bad Request, url: https://unipro.atlassian.net/rest/api/latest/project? json: {"errorMessages":["Can not construct instance of com.atlassian.jira.rest.v2.issue.project.ProjectBean$AssigneeType from String value 'MIKE.DOHERTY': value not one of declared Enum instance names\n at [Source: org.apache.catalina.connector.CoyoteInputStream@bcc0d0; line: 1, column: 123] (through reference chain: c om.atlassian.jira.rest.v2.issue.project.ProjectInputBean[\"assigneeType\"])"]} Remote error: Can not construct instance of com.atlassian.jira.rest.v2.issue.project.ProjectBean$AssigneeType from String value 'MIKE.DOHERTY': value not one of declared Enum instance names at [Source: org.apache.catalina.connector.CoyoteInputStream@bcc0d0; line: 1, column: 123] (through reference chain: com.atlassian.jira.rest.v2.issue.project.Pr ojectInputBean["assigneeType"]) org.swift.common.cli.AbstractRemoteClient$RemoteRestException: Can not construct instance of com.atlassian.jira.rest.v2.issue.project.ProjectBean$AssigneeType f rom String value 'MIKE.DOHERTY': value not one of declared Enum instance names at [Source: org.apache.catalina.connector.CoyoteInputStream@bcc0d0; line: 1, column: 123] (through reference chain: com.atlassian.jira.rest.v2.issue.project.Pr ojectInputBean["assigneeType"]) at org.swift.common.cli.AbstractRestClient.printErrorMessages(AbstractRestClient.java:291) at org.swift.common.cli.AbstractRestClient.restRequestWithUrlConnection(AbstractRestClient.java:716) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:571) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489) at org.swift.jira.cli.JiraRestClient.createProject(JiraRestClient.java:643) at org.swift.jira.cli.helpers.ProjectHelper.createProject(ProjectHelper.java:230) at org.swift.jira.cli.helpers.ProjectHelper.createProject(ProjectHelper.java:170) at org.swift.jira.cli.helpers.ProjectHelper.createProject(ProjectHelper.java:124) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:812) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:312) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153)

    JIRA | 1 year ago | Mike Doherty
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: Can not construct instance of com.atlassian.jira.rest.v2.issue.project.ProjectBean$AssigneeType f rom String value 'MIKE.DOHERTY': value not one of declared Enum instance names at [Source: org.apache.catalina.connector.CoyoteInputStream@bcc0d0; line: 1, column: 123] (through reference chain: com.atlassian.jira.rest.v2.issue.project.Pr ojectInputBean["assigneeType"])
  6. 0

    bq. Error cloning service desk project: An invalid project template was specified. Make sure the project template matches the project type you specified. Trying to clone an existing service desk project but receive error about invalid project template specified. Have tried using --template with both "IT Service Desk" and "Basic Service Desk" as well as "com.atlassian.servicedesk:itil-service-desk-project" but always same error: c:\z\jira-cli-5.3.0>jira.bat --server http://ost-mgds-jira.mgds.local:8081 --user admin --password pass --action cloneProject --project "MGDSSD" --toProject "CLONESD" --name "CloneTest - Servicedesk" --template "IT Service Desk" --cloneIssues --copyVersions --copyComponents --copyRoleActors --copyAttachments --copyComments --copyWatchers --copyLinks --copySubtasks --continue -v Server address: http://ost-mgds-jira.mgds.local:8081 Response code: 200, message: OK, url: http://ost-mgds-jira.mgds.local:8081/rest/org.swift.jira.cli/latest/validatelicense? check JIRA release: 7.1.2 URL requested: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD? Request type: GET Content type: application/json Response code: 200, message: OK, url: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD? URL requested: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD/issuesecuritylevelscheme? Request type: GET Content type: application/json Response code: 404, message: Not Found, url: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD/issuesecuritylevelscheme? json: {"errorMessages":["Security level for project MGDSSD does not exist."],"errors":{}} 404 indicates there is no issue security associated with this project. URL requested: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD/notificationscheme? Request type: GET Content type: application/json Response code: 200, message: OK, url: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD/notificationscheme? URL requested: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD/permissionscheme? Request type: GET Content type: application/json Response code: 200, message: OK, url: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project/MGDSSD/permissionscheme? URL requested: http://ost-mgds-jira.mgds.local:8081/rest/project-templates/1.0/templates?os_username=admin&os_password=*** Request type: GET Content type: application/x-www-form-urlencoded Response code: 200, message: OK, url: http://ost-mgds-jira.mgds.local:8081/rest/project-templates/1.0/templates?os_username=admin&os_password=*** Project template list: [[name: Scrum software development, projectTemplateModuleCompleteKey: com.pyxis.greenhopper.jira:gh-scrum-template, itemModuleCompleteKey: com.pyxis.greenhopper.jira:gh-scrum-template, allowCreateProject: true], [name: Kanban software development, projectTemplateModuleCompleteKey: com.pyxis.greenhopper.jira:gh-kanban-template, itemModuleCompleteKey: com.pyxis.greenhopper.jira:gh-kanban-template, allowCreateProject: true], [name: Basic software development, projectTemplateModuleCompleteKey: com.pyxis.greenhopper.jira:basic-software-development-template, itemModuleCompleteKey: com.pyxis.greenhopper.jira:basic-software-development-template, allowCreateProject: true], [name: Basic Service Desk, projectTemplateModuleCompleteKey: com.atlassian.servicedesk:classic-service-desk-project, itemModuleCompleteKey: com.atlassian.servicedesk:classic-service-desk-project, allowCreateProject: true], [name: IT Service Desk, projectTemplateModuleCompleteKey: com.atlassian.servicedesk:itil-service-desk-project, itemModuleCompleteKey: com.atlassian.servicedesk:itil-service-desk-project, allowCreateProject: true], [name: Project management, projectTemplateModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-project-management, itemModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-project-management, allowCreateProject: true], [name: Task management, projectTemplateModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-task-management, itemModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-task-management, allowCreateProject: true], [name: Process management, projectTemplateModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-process-management, itemModuleCompleteKey: com.atlassian.jira-core-project-templates:jira-core-process-management, allowCreateProject: true]] URL requested: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project? Request type: POST Content type: application/json Post data: {"projectTemplateKey":"com.pyxis.greenhopper.jira:basic-software-development-template","name":"CloneTest - Servicedesk","description":"","assigneeType":"UNASSIGNED","projectTypeKey":"service_desk","key":"CLONESD","lead":"mglenn@ostusa.com","url":"http:\/\/ost-mgds-jira.mgds.local:8081\/browse\/MGDSSD"} Response code: 400, message: Bad Request, url: http://ost-mgds-jira.mgds.local:8081/rest/api/latest/project? json: {"errorMessages":["An invalid project template was specified. Make sure the project template matches the project type you specified."],"errors":{}} Remote error: An invalid project template was specified. Make sure the project template matches the project type you specified. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: An invalid project template was specified. Make sure the project template matches the project type you specified. at org.swift.common.cli.AbstractRestClient.printErrorMessages(AbstractRestClient.java:293) at org.swift.common.cli.AbstractRestClient.restRequestWithUrlConnection(AbstractRestClient.java:718) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:573) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:544) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:519) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:507) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:491) at org.swift.jira.cli.JiraRestClient.createProject(JiraRestClient.java:654) at org.swift.jira.cli.helpers.ProjectHelper.createProject(ProjectHelper.java:256) at org.swift.jira.cli.helpers.ProjectHelper.cloneProject(ProjectHelper.java:474) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:911) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:448) at org.swift.common.cli.CliClient.doWork(CliClient.java:454) at org.swift.jira.cli.JiraClient.main(JiraClient.java:160) c:\z\jira-cli-5.3.0> I am not sure if it is relevant but the last Post data in the output above always has projectTemplateKey set to com.pyxis.greenhopper.jira:basic-software-development-template even if I specify something different with --template: Post data: {"projectTemplateKey":"com.pyxis.greenhopper.jira:basic-software-development-template","name":"CloneTest - Servicedesk","description":"","assigneeType":"UNASSIGNED","projectTypeKey":"service_desk","key":"CLONESD","lead":"mglenn@ostusa.com","url":"http:\/\/ost-mgds-jira.mgds.local:8081\/browse\/MGDSSD"} Please advise, thank you.

    JIRA | 7 months ago | Chris House
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: An invalid project template was specified. Make sure the project template matches the project type you specified.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.swift.common.cli.AbstractRemoteClient$RemoteRestException

      User is not authorized to perform the request. Response code: 401.

      at org.swift.common.cli.AbstractRestClient.handleBadResponseCode()
    2. org.swift.common
      AbstractRestClient.restRequest
      1. org.swift.common.cli.AbstractRestClient.handleBadResponseCode(AbstractRestClient.java:722)
      2. org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:692)
      3. org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542)
      4. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517)
      5. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505)
      6. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489)
      6 frames
    3. org.swift.jira
      JiraClient.handleRequest
      1. org.swift.jira.cli.JiraRestClient.getServerInfo(JiraRestClient.java:1835)
      2. org.swift.jira.cli.JiraClient.getServerInfoAlternate(JiraClient.java:1856)
      3. org.swift.jira.cli.JiraClient.getRemoteServerInfo(JiraClient.java:1829)
      4. org.swift.jira.cli.JiraClient.validateJiraRelease(JiraClient.java:1978)
      5. org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:710)
      5 frames
    4. org.swift.common
      CliClient.doWork
      1. org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288)
      2. org.swift.common.cli.CliClient.doWork(CliClient.java:433)
      2 frames
    5. org.swift.jira
      JiraClient.main
      1. org.swift.jira.cli.JiraClient.main(JiraClient.java:153)
      1 frame