i wanted to answer to this question but the question was already closed:
https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-delete-issue-type-using-groovy/qaq-p/501207
so i am posting my solution here:
this is how you can remove an issue type (and also add an issue type) from an project.
the cool thing is that the existing issues will not be affected but it is only prevented that users can choose the target issue type in "create issue" screen. works for me with Jira 8.5
please try out if you need that:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.option.OptionSetManager
import com.atlassian.jira.issue.fields.config.FieldConfigScheme
import com.atlassian.jira.issue.fields.option.OptionSet
import com.atlassian.jira.issue.IssueFieldConstants
import com.atlassian.jira.project.Project
def targetissuetypeID = "10001" //story
def projectKey = "MSA"
//get needed components
def itsm = ComponentAccessor.issueTypeSchemeManager
def opsm = ComponentAccessor.getComponent(OptionSetManager)
def pm = ComponentAccessor.projectManager
//set vars with required objects from user input
def proj = pm.getProjectByCurrentKey(projectKey)
def issueTypes = itsm.getIssueTypesForProject(proj)
//get fieldconfig scheme for target project. you should maybe check if scheme is not global so that other projects are not affected
FieldConfigScheme scheme = itsm.getConfigScheme(proj)
//issue types that can be seen in 'create issue' screen are stored as options
OptionSet options = opsm.getOptionsForConfig(scheme.getOneAndOnlyConfig())
def newoptionsArray = []
newoptionsArray = options.getOptionIds()
//remove target issue type
newoptionsArray.remove(targetissuetypeID)
itsm.update(scheme, newoptionsArray)
//add an existing issue type to project
//options.addOption(IssueFieldConstants.ISSUE_TYPE, targetissuetypeID)
//itsm.update(scheme, options.getOptionIds())