Attempt to de-reference a null object error when trying to sync external user storiesWhen you try to sync external user stories from the project record, the job might fail because of the error 'Attempt to de-reference a null object'.
You can verify the status of the job by going to Setup > Apex Jobs
If the job fails, the same will be mentioned in the 'Status' column and the reason will be mentioned in the 'Status Detail' column:
There can be 3 main reasons for the job to fail with this error:
1. 'Username' set in the named credential might not have access to the project.
In JIRA, you can verify this by navigating to Project > Project Settings > Access. If you do not find the integration user used, you have to add it using the 'Add people' button:
In Azure, you can go to the project > Overview > Summary > Members section to verify the same. You can use the 'Invite' button to add the user.
2. Value populated in the 'Project External Id' field of the project record in your Copado org might be wrong.
In JIRA, you can get the key by navigating to Project > Project Settings > Details:
In Azure, once you go to the project, you can get the value from the URL (For example, if the URL is https://dev.azure.com/rajathpai99/test%20project, then test%20project would be the 'Project External Id')
3. 'JQL Extended Filter' (in case of JIRA integration)/'Workspace Id' (in case of Azure integration) field of the project record in your Copado org might have the wrong value populated.
In JIRA, you can go to Filters > Advanced issue search and then enter the query in the search box to see if it results in proper syntax
In Azure, you can append the string /_queries/query/<Workspace Id>/ after the project in URL to see if it displays the result. This can be performed by the integration user.
Sample URL: https://dev.azure.com/rajathpai99/test%20project/_queries/query/84968426-b2a3-4f84-a36f-d670bb0d8674/
In case if it does not display the result/gives an error, you can go to the project > Boards > Queries > New query, run it, save it, get the ID and update it in the 'Workspace Id' field.
In case, if all of them looks good, please contact Copado Support.