Invalid Issue Type Selected

    Problem

    Error details:

    ERROR: Field The issue type selected is invalid.: issueType

    Cause

    This is a common problem related to an Atlassian bug. After you delete a next-gen project, the issue type "scope" of that project is deleted, but not the issue types themselves. This means that the duplicate issue types where only one of them is valid remain. 

    Solutions

    Solution 1

    1. Go to the Project Trash of your Jira and permanently delete the Jira Next-Gen Projects that caused the duplicate issue types in the first place.

    Solution 2

    1. If Solution 1 is insufficient (you are unable to permanently delete the project(s), go to the following API endpoint with your Jira Cloud URL to find out what the problematic issue types are:

       $JIRA_CLOUD_URL/rest/api/3/issuetype
    2. Write down the issue type ID of the correct issue types that you wish to set.
    3. Change your Exalate Incoming Sync scripts to set the issue type by ID instead of name:

      //In this example, you are mapping the received issue types "Story" and "Epic" to the corresponding ID's in your Jira (5 and 6).
      if (firstSync) {
          issue.projectKey = "TEST"
          def remoteType = replica.typeName
          def typeNameToIdMap = ["Story":"5","Epic":"6"]
          issue.customKeys.issueTypeId = typeNameToIdMap[remoteType] ?: "5"
      }