Create Issue error referencing a custom field that was deleted

Wayne Grebe December 26, 2012

I am getting the following error when I submit a Create Issue (Jira OnDemand);

Error creating issue: Unable to find field 'customfield_10313'

This custom field was deleted, but for some reason is still being referenced. My guess is that the error is related to a Post Function that was created using the Jira Suite Utilities plugin. I did not update the Post Function before deleting the field, assuming that all references to that field would be purged.

What do I do now?

Thanks in advance, Wayne

2 answers

1 accepted

5 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 26, 2012

Oh, yuck, I hate it when I do that. The short answer is to manually edit the workflow and look at the create transition, removing any offending post-functions. It might also be happening in a listener, so you'll need to check those as well if you've configured any.

One quick cheat for workflows - if you download a suspect one to xml, you can do simple text searches on it to see where 10313 is in use, then go back into Jira and remove the functions referring to it - this can be quicker than reading every single post-function, condition and validator...

Wayne Grebe December 26, 2012

Ok, I just reviewed the XML and the Post Function is in it, but it is not visible via the workflow edit.

- <function type="class">
<arg name="field.value">Unresolved</arg>
<arg name="class.name">com.googlecode.jsu.workflow.function.UpdateIssueCustomFieldPostFunction</arg>
<arg name="field.name">customfield_10313</arg>
</function>
Wayne Grebe December 26, 2012

Thanks Nic. I tried editing the post function, but the refernce to the custom filed is no longer displayed. I assume it's not visible because the custom field referenced in the Post Function has been deleted. yet I am still receiveing an error, as if the Post Function still exists.

Of course, all this is assuming that this is what's causing the problenm in the first place.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 26, 2012

Bother, I was afraid of that - Jira can't display the broken post-functions (and hence the options to edit/delete them).

You've got two options:

1. Create a new workflow and migrate the project over to use it

2. (This one is risky and really desperately needs you to take a solid database backup before you try it). Add a new field of the same type and name. Do NOT put it on any screens, or give it options or defaults. Stop Jira, use SQL to change the new field's ID to 10313. Restart Jira, edit the functions out of your workflows and then delete the new field.

Wayne Grebe December 26, 2012

Yeah, I'm going down the option #1 road right now because I figured that was at the very least my fallback. Seems to me that this is a bug in Jira... that it's not cleaning up all of the post functions related to a field when it's deleted.

Thanks for the help Nic!

Joe Jira March 20, 2015

Thanks @Nic Brough [Adaptavist] and @Wayne Grebe for the help. I recently had the exact same issue appear on my v6.1.5 instance of JIRA. Unfortunately the bad field was all over the place in many of my workflows. I was able to resolve them methodically by: # Export the workflow to XML # Manually remove the section from XML and save # Create a new Workflow by importing the customized/cleaned xml # Associating projects with the new workflow

Andrei [errno]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2016

did the same steps as Joe Jira: XML export / manual edit (deleted a few lines for 1 postfunction) / save / import / associate workflow

Indranil Mondal October 14, 2016

Hi Nic, How to resolve it if the issue is not due to any post function but for the field (deleted custom field) being marked as mandatory in field configuration? I have tried using another field configuration copying from default one but still that error message is coming. I dont have access to database.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 14, 2016

Er, that doesn't happen.  If you delete a field, it's gone.  It can't be marked mandatory in the field config because it's not there.  There's nothing to check.

Indranil Mondal October 14, 2016

when the field was deleted from custom fields it was already made required in the field configuration for that issue type.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 14, 2016

That does not matter.  If you delete the field, there is nothing in the field configuration for it, because there's no field.  Even if it hangs over in the database (which it does not), it doesn't do anything because the field has gone.

You have a function using it somewhere.

1 vote
Megan Makowiecka June 6, 2016

I just recently did this and was able to quickly fix it buy creating a new transition and deleting the problem one. A lot easier than having to recreate the workflow.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 6, 2016

Doesn't always work though - it depends on the whether the damaged transition is still coherent enough to be referenced by the editor.

Suggest an answer

Log in or Sign up to answer