Error "Issue Type for issue with id '...' is null" when searching issues in Jira

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

    

Problem

When searching for issues in Jira, a big block of errors might be shown on the screen, starting with:

The message is "An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in class com.atlassian.jira.issue.fields.layout.column.ColumnLayoutItemImpl threw exception java.lang.IllegalArgumentException: Issue Type for issue with id '...' is null."

Environment

Confirmed in Jira 8.5 and Jira Service Management 4.5.

Likely to happen on several Jira 7 and 8 versions as well.

Diagnosis

The error on the screen will start with:

An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getHtml' in class com.atlassian.jira.issue.fields.layout.column.ColumnLayoutItemImpl threw exception java.lang.IllegalArgumentException: Issue Type for issue with id '...' is null.

And in the atlassian-jira.log we should see:

2020-05-07 07:54:00,037 http-nio-127.0.0.1-8080-exec-61 ERROR <username> 473x2230574x1 e0lj6e <ip addresses>,127.0.0.1 /issues/ [c.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.IllegalArgumentException: Issue Type for issue with id '...' is null.

Which '...' can be any number that represents an issue's internal id on the jiraissue database table.

Cause

This error is caused due to issues not having an associated issue type, just like the error messages suggest.

This is an exception to Jira's behavior and might have happened during interrupted operations like moving issues, bulk editions, data import or direct interference on the database.

Solution

The solution is to identify the corrupted issues, fix them on the database and further delete them if needed.

(info) The queries below are for the PostgreSQL database. You may need to alter them for your own database type.

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

  1. The number of affected issues might be higher than what was triggered by the issue search, so we perform a broader search on the database:

    select i.id, p.pkey, i.issuenum, i.issuetype
    from jiraissue i
    join project p on p.id = i.project
    where i.issuetype is null or i.issuetype in ('', ' ');
  2. For each different project key (pkey) that was returned above, select an issue type id available from the output of the query below:

    select p.pkey, it.id, it.pname
    from project p
    join configurationcontext cc on p.id = cc.project
    join fieldconfigschemeissuetype fci on fci.fieldconfigscheme = cc.fieldconfigscheme
    join optionconfiguration oc on oc.fieldconfig = fci.fieldconfiguration
    join issuetype it on it.id = oc.optionid
    where p.pkey = 'PROJECT-KEY'; -- <<< Replace PROJECT-KEY
  3. Update the issues with the desired issue type id:

    To update issues separately
    update jiraissue set summary = 'abcdefghijk', issuetype = <issue-type-id> where id in (<list of issue ids separated by comma>);
    To update all corrupted issues
    update jiraissue set summary = 'abcdefghijk', issuetype = <issue-type-id> where issuetype is null or i.issuetype in ('', ' ');
  4. Restart Jira

  5. After Jira's back online, we may search for those corrected issues and bulk edit them as we want — even bulk delete them if that's the intention.

    JQL to search for the issues
    summary ~ 'abcdefghijk'




Last modified on Nov 16, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.