I would like to set a custom field back to it's default value when an issue is re-opened. I know how to set a value during a transition and even how to get the current value via a Groovy script but I can't seem to find a way to find the field's default value? Right now we have the default value "hard coded" into a post function but the field's default value changes on a monthly basis so I'd like to be able to update the default value in the Custom Field configuration without having to go and also change all my Post Functions.
Please note that while we have JIRA Misc Workflow Extensions, we don't have Script Runner.
Thanks for the help!
You can use the following script:
CustomFieldManager customFieldManager = ComponentAccessor.customFieldManager;
CustomField customField = customFieldManager.getCustomFieldObjectByName("select")
FieldConfig relevantConfig = customField.getRelevantConfig(issue);
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot