renaming issue type scheme to given value using groovy script

Sumit Kumar
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.
February 25, 2014

I want to rename issue type scheme to a given "String value" using groovy.

is it possible , if Yes how ?

Thanks in advance ..!!

Regards,

Sumit

1 answer

1 accepted

0 votes
Answer accepted
Andreas Ebert
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.
February 25, 2014

Its relatively straight-forward. Try something like this for JIRA 6:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.config.FieldConfigScheme;

itsm = ComponentAccessor.issueTypeSchemeManager;

for (scheme in itsm.allSchemes) {
    // 1. get the scheme we want to edit
    if (scheme.name == "old scheme name") {
        // 2. edit our scheme
        itsm.update(
                new FieldConfigScheme.Builder(scheme)
                        .setName("new scheme name")
                        .toFieldConfigScheme(),
                scheme.associatedIssueTypeIds);

    }
}

I didn't test my code. So, try to run it in a test-system first, just in case. :)

Sumit Kumar
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.
February 26, 2014

Can you tell me same for renaming Workflows , Field Configurations & Screen Scheme ?

Thanks in advance.!

Regards,

Sumit

Andreas Ebert
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.
February 26, 2014

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events