renaming workflow, field configuration and screen schemes using groovy

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

Jira Version : 5.2.10

3 answers

1 accepted

1 vote
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 26, 2014

In all 3 cases you have to:

  1. get the configuration entity you want (using the appropriate Manager)
  2. edit its name (again, using the right Manager)

For workflows, use WorkflowManager and its methods getWorkflowClone(name) and updateWorkflowNameAndDescription(username, workflow, newName, newDescription).

For Field Configurations it's a bit confusing, because internally they are called "FieldLayout" (take a look at the URL when manually editing a Field Configuration :D). Use FieldLayoutManager#getEditableFieldLayout(id) to get the FieldLayout, then FieldLayout#setName(newName), then FieldLayoutManager#storeEditableFieldLayout(myFieldLayout).

For Screen Schemes, use FieldScreenSchemeManager#getFieldScreenScheme(id), then FieldScreenScheme#setName(newName), then FieldScreenScheme.save().

Use com.atlassian.jira.component.ComponentAccessor to get the Managers, as I showed in your previous question.

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 27, 2014

Thanks I hope this will wok out for me, I will accept the answer once it is tested out and share the complete scripts.

Regards,

Sumit

0 votes
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

There will be 3 different scripts .. each for

Renaming Workflow

Renaming Field Congurations

Renaming Screen Schemes

Also, please let me know if there are another ways available.

Thanks,

Sumit

0 votes
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

The title is ambiguous.
Do you want to rename Workflows, Field Configurations and (Field) Screen Schemes?
Or Workflow Schemes, Field Configuration Schemes and (Field) Screen Schemes?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events