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!
finding the default value of a field in Jira is actually overly complicated. It really depends on the type of custom field. If you tell me which custom field type it is, I might be able to provide the appropriate code.
You can use the following script:
CustomFieldManager customFieldManager = ComponentAccessor.customFieldManager;
CustomField customField = customFieldManager.getCustomFieldObjectByName("select")
FieldConfig relevantConfig = customField.getRelevantConfig(issue);
In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to have–in order to produce a reliable long-term roadmap. We're tur...
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
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs