I need to dinamically add options to a single select custom field inside a post function. When jira receives an email it creates an issue and than process a transaction. Inside email there is a value that I must select in a single select custom field. But that field could not have such option. So I need to add a new option and than select it. I don't know how to add new option inside a post function.
Let say for example I have the field Colors with contains a list of colurs. User send an email containing the color to set. But the color choosed by user could not be present in the Colors field. So, if the color is purple and that option is not present, I must add a new option "purple" and than select it. I know how to select the value but don't know how to add it.
How can I add new options?