Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Java API returns incorrect issue type, but REST API returns correct one (Jira Data Center 9.12.12)

sainath
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2025

 Hi community,

I'm working on a Jira Data Center instance (version 9.12.12) and facing an issue when trying to retrieve the issue type of an issue programmatically.

When using the Atlassian Java API:

 issue.getIssueType().getName()

It returns an unexpected or incorrect issue type.

However, when I fetch the same issue via the Jira REST API:

 GET /rest/api/2/issue/{issueIdOrKey}

It returns the correct issue type.

I have created a custom issue type called "Feature". That feature is associated with this issue, KSD-8. 

While fetching this issue through JQL via Atlasian Java classes in the data center, the response in which issue type was expected issue type, is "Feature", but the Java API returns "Epic" instead.

Here is the correct REST API response:

 "issuetype": {
  "self": "http://localhost:2990/jira/rest/api/2/issuetype/10014",
  "id": "10014",
  "description": "conversion of epic",
  "iconUrl": "http://localhost:2990/jira/secure/viewavatar?size=xsmall&avatarId=10307&avatarType=issuetype",
  "name": "Feature",
  "subtask": false,
  "avatarId": 10307
}

What I've Tried:

  • Verified issue type schemes and associations.

  • Reindexed the instance.

  • Restarted Jira and cleared plugin caches.

 Question:

Why does the Java API return the wrong issue type (e.g., "Epic") when the REST API and UI clearly show the correct type ("Feature")?

Any help or suggestions would be greatly appreciated.

Thanks in advance!
Sainath Bembre

2 answers

0 votes
Aron Gombas _Midori_
Community Champion
June 19, 2025

@sainath The issue type names can be translated!

I think it is worth a try if this getter returns what you expect: 

 issue.getIssueType().getNameTranslation()

Also, what you could also check if the getId() getter on the issue type returns the same ID that is returned by the REST API.

If it does, at least you can be sure that you are working with the issue type and only the name differs. If even the IDs are different, it means you are looking at two different issue types!

0 votes
Stefan Stadler
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.
June 19, 2025

Hi @sainath 

could you please share the complete Java code you are using? It might be that this is something with the retrieval of the issue object. Usually the Java API and REST API should be returning the same results. 

Furthermore: Are you using translations on your instance? I have been running in strange issues using translations, so that also might come into play here.

Regards,

Stefan

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events