During a Jira migration to a new Jira Data Center instance where issue keys remain the same as in the previous instance”I am attempting to associate preconditions, test sets, and test plans to a test case using the JIRA APIs, following the official documentation precisely. However, when I use, for example, PUT server/rest/api/2/issue/testkey to associate customfield_id preconditions, test set, test plan and sending a correct json I encounter a null pointer exception stating: a cannot invoke java.lang.Integer.intValue because parameter 2 is null, and the API call returns a 400 error code along with the corresponding log trace. java.lang.NullPointerException: Cannot invoke \"java.lang.Integer.intValue()\" because parameters 2 is null"],"errors":{}}
I have verified that all the custom fields are present on the screens, performed both background and full re-indexing, and even implemented retry mechanisms, but nothing has worked. Interestingly, when I manually open the ticket in the Jira browser and then rerun my script without modifying the code, the request succeeds for that ticket (returning a 204 no content status code).
Since I have approximately 4600 test issues, manually opening each one is not possible
Could you please help identify the cause of this issue and suggest a possible resolution?
jira datacenter version : 09.12.14
Xray: 7.8.2-j9
Hi @Salim ,
This issue is likely caused by missing or uninitialized field context or metadata for the migrated issues in the new Jira Data Center instance. When you manually open an issue in the browser, Jira loads and initializes all field contexts and caches for that issue, which is why subsequent API calls succeed.
I'm not sure if this is correct or we have any other way, this is what I did in my prev migration.
Bulk Edit to Force Re-Save of Issues
Use Jira’s Bulk Change → Edit Issues feature to force Jira to re-save all affected issues, even without changing any values.
Steps:
This action:
Forces Jira to persist each issue again
Fully initializes all custom fields and their contexts
Makes the issues immediately usable by REST APIs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.