Create Issue error referencing a custom field that was deleted

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
Accepted answer

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...

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="">com.googlecode.jsu.workflow.function.UpdateIssueCustomFieldPostFunction</arg>
<arg name="">customfield_10313</arg>

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.

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.

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!

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

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

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.

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.

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

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.

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.

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
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,084 views 4 9
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you