"Unable to connect to the server" error when editing a ConnectALL automation after deleting a Jira project
search cancel

"Unable to connect to the server" error when editing a ConnectALL automation after deleting a Jira project

book

Article ID: 426726

calendar_today

Updated On:

Products

ConnectAll On-Prem ConnectALL ConnectAll SaaS

Issue/Introduction

After deleting a Jira project, it is no longer possible to edit an automation.

The user interface shows the following error:

Unable to connect to the server

 

UI logs may show the following DEBUG error:

DEBUG YYYY-dd-MM hh:mm:ss,zzz http-nio-8080-exec-# com.go2group.connectall.jira.JiraRestConnector - Exception occurred in getting the Issue types from Jira {"errorMessages":["No project could be found with key 'SAMPLE'."],"errors":{}}
 

Followed by the following stack trace:

ERROR YYYY-dd-MM hh:mm:ss,zzz http-nio-8080-exec-# com.g2g.connector.jira.JIRAConnector - General Exception thrown in connecting Jira
java.lang.Exception: Exception occurred in getting the Issue types from Jira {"errorMessages":["No project could be found with key 'SAMPLE'."],"errors":{}}
at com.go2group.connectall.jira.JiraRestConnector.getIssueTypesInProject(JiraRestConnector.java:1569) ~[Connectors-4.0.0.jar:4.0.0]
at com.g2g.connector.jira.JIRAConnector.getIssueTypesInProject(JIRAConnector.java:697) ~[classes/:4.0.0]
at com.g2g.connector.jira.JIRAConnector.getIssueTypes(JIRAConnector.java:675) ~[classes/:4.0.0]
at com.g2g.connector.jira.JIRAConnector.getIssueTypes(JIRAConnector.java:668) ~[classes/:4.0.0]
at com.g2g.connector.jira.JIRAConnector.getMetaData(JIRAConnector.java:352) ~[classes/:4.0.0]
 

 

Cause

Under normal circumstances it is possible to delete a project in Jira and still be possible to edit the automation if it is a multi-project automation.  However, if the deleted project is the template project for the automation, then this issue can occur.

Resolution

Set up a REST API request to update the template project.  Included Below are sample curl requests that can be converted to Postman or Bruno requests.

First, identify the ID of the automation.  Edit the highlighted areas to fit your situation.

curl --request GET \
  --user <user>:<password> \
  --url 'https://<connectall_host_url>/ConnectAll/api/private/v2/automations?pageSize=100'

 

Second, issue a patch request using the ID of the automation and a valid project you wish to use for a template.

curl --request PATCH \
  --user <user>:<password> \
  --url 'https://<connectall_host_url>/ConnectAll/api/private/v2/automations/<id>/applications/source' \
  --header 'content-type: application/json' \
  --data '{
  "templateProject": "SAMPLE"
}'