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);
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
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