Changed Jira client import script fails after update to 2022.1 Follow
I've applied changes to some of the Jira client import scripts. Those changes worked with YT releases 2021.3 and 2021.4.
Now I'm using 2022.1 and an import from Jira fails.
I'm starting the import wizard, enter my connection information as usual and click next expecting to get a list of Jira projects to choose from.
But the wizard stepping fails. I get this message just above the Back/Next/Cancel bottons:
class jetbrains.youtrack.scripts.model.MiscellaneousObject cannot be cast to class jetbrains.youtrack.imports.model.ScriptingClientFactory (jetbrains.youtrack.scripts.model.MiscellaneousObject and jetbrains.youtrack.imports.model.ScriptingClientFactory are in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @33f57cbc)
In order to narrow down the issue I've started with a new Docker container of YT 2022.1.
Without any changes to the OOTB Jira client import scripts (i.e. none of my changes applied) the wizard step works well. I get the list of Jira projects to choose from. As it is just a test of the step in the wizard I cancel the import.
Now, in the workflow editor I applied one small of my changes that used to work. In @jetbrains/youtrack-jira-client/links I've changed line 18 to be a comment:
If I start the wizard again I run into the same error mentioned above.
It feels like any changes to the OOTB script triggers some compile step that fails for some dependency issue. But this is just a vague guess.
Any hint how to solve or workaround this issue are very welcome!
Please sign in to leave a comment.
Update: I tried it again with a new container this morning and after changing the import scripts in the workflow editorof YT the import wizard still worked and the actual import was successful as well. The difference I'm aware of is that the host for the Docker host (WSL/Ubuntu) was updated this morning. I'll test whether it does work with editing the scripts externally and uploading them (https://www.jetbrains.com/help/youtrack/devportal/js-workflow-external-editor.html) which is the usual approach I use to edit YT scripts.
Update 2: If I edit the scripts externally and upload them via npm as documented then I run into the error in the import wizard. So a development environment that worked fine for editing scripts for UT 2021.3 and 2021.4 seems not to be usable anymore after the YT system has been upgraded to 2022.1.
I've just checked YouTrack 2022.1 in Docker but wasn't able to reproduce the problem. Let me please clarify a couple of details to investigate it further:
Am I right the customized import worked well when running a fresh 2022.1 installation? Is the problem reproduced only for upgraded YouTrack?
Also, am I right that uploading scripts via npm results in the error even on the fresh installation?
I'm looking forward to your reply.
Hi Anastasia Bartasheva,
no, the problem happens with both, an upgraded installation as well as a new one.
Yes, the problem seems to happen only if I upload the script via npm, even on a fresh installation.
I re-checked this morning:
1. created new container from 2022.1 image
2. set up YouTrack freshly in the new container
3. opened workflow editor of YouTrack with the link in the the Jira import wizard
4. applied change (the small one mentioned in my OP)
5. in the Jira import wizard clicked Next on the host and credential step
=> no error, all fine
6. cancelled Jira import wizard
7. downloaded @jetbrains/youtrack-jira-client via npm
8. reverted the change I've made in step 4. in a local editor
9. uploaded @jetbrains/youtrack-jira-client via npm
10. started the Jira import wizard again and clicked Next on the host and credential step
Anastasia Bartasheva: I've done the 10 steps documented in my previous post but with a 2021.4 container. Step 10 did not produce an error - all went fine.
Anastasia Bartasheva: Here is the error from the import.log:
I appreciate your patience. I have reproduced the issue and filed a bug: https://youtrack.jetbrains.com/issue/JT-68744. Please feel free to follow it to receive further updates. Thank you for reporting about it!
Thanks for the update, Anastasia Bartasheva.