![]() Please note however, that if your custom field stores any other values (suchĪs options for example), they will have to be removed by the caller of this method, as the custom field type Will also call to the CustomFieldValuePersister.removeAllValues(String) ![]() Otherwise, the customfield and all associated configurations will be removed. If it doesn't exist in the database, an IllegalArgumentException willīe thrown. Type is no longer available (a plugin may have been removed), then this method will try to lookup the customįield directly in the database. If however the customfield object cannot be retrieved via the manager, which may be the case if the custom field This method should only be used ifĪ customfield needs to be removed when the customfieldtype for that field is no longer available! Method to remove a custom field, as it is guaranteed to remove all data. NOTE: Generally you should use the removeCustomField(.fields.CustomField) RemoveCustomField(.fields.CustomField) method, which will not leave any orphaned If the customfield object can be retrieved this way, it simply delegates the removal to the This method will try to lookup the customfield object via the manager first. It might not make a difference, but it is a subtle change that is worth noting.Removes the customfield supplied. The difference here though is that this issue would have an actual value for that field when it is created as compared to being a true Null. In which case you could then use the rest call to set the field value to "none". That way you don't have to set a value in your rest call when creating the issue for issues unless the issue needs to have a different value hereĢ: You could create a new option for this field, and call it something like "unset" or "none". There are a couple of different changes you could make to this field in order get around this.ġ: You could set a default value for this field here. Right now your custom field looks something like this in the Jira UI under Issues -> Custom Fields: ![]() I understand there are some other templates in play here so perhaps that isn't the ideal solution here.Īlternative to that, you might be able to get around this problem by changing the configuration of the custom field in Jira. It looks like you have already explored some other alternatives such as simply not including that field to be defined when the issue is created by removing it from the rest call. But there is not a way to call that field to have a value and just pass it a null here. By default in Jira, most custom fields that don't have any value will remain with a null or empty value for this field in the database level. ![]() You can't set a null value when you are explicitly calling the field itself to have a value. I'm testing these requests in Postman and eventually building them into a Java application. How can I specify that the default value be set. I'd also need to set it back to default later. I know if I remove the 'customfield' piece entirely, the default will be used, well, by default - but It would be much easier (because we're using API call templates) to just explicitly specify that it should use the default. When I inspect the select element, I see the id is -1 and the value is 'None' - but there must be more to it. "customfield_20582": "Could not find valid 'id' or 'value' in the Parent Option object." "customfield_20582": "Option id 'null' is not valid" If I change the 'customfield' bit to 'High', 'Medium' or 'low' it also works fine.īut when I try to set the value to be the default 'None' i get issues: Without the 'customfield_20582' bit - this works perfectly, and i get a response with the newly created Issue key. I have a request to create a new issue like this: It has values 'high', 'medium', 'low' and the default which is 'none'. I have a JIRA board which has a custom field: customfield_20582 which shows up as 'priority', say, in the UI.
0 Comments
Leave a Reply. |