Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to change the issuetpye with script runner

VINSTON WEN October 11, 2020

 

I hava find Ref: https://community.atlassian.com/t5/Answers-Developer-Questions/Changing-the-issue-type-with-groovy/qaq-p/543998

code : 

import com.atlassian.jira.component.ComponentAccessor

def newIssueType = ComponentAccessor.issueTypeSchemeManager.getIssueTypesForProject(issue.projectObject).find{it.name=="support"}
if (newIssueType) issue.setIssueTypeObject(newIssueType)

The issue type does change, but the workflow seems to only be partially migrated. The View Workflow button on the issue does show the new workflow, but no workflow buttons are available.

1 answer

0 votes
Nic Brough -Adaptavist-
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.
October 11, 2020

I suspect your issue types are configured differently. 

The line of code you have found there only works for issue types that are using exactly the same configurations.  If you want to change between issue types properly, you need to code for all the migration between configurations as well.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events