Hello all,
I want to migrate webhooks to different JSM instances. And I’ve add the following packages to my pom.xml.
<dependency>
<groupId>com.atlassian.jira.plugins.webhooks</groupId>
<artifactId>jira-webhooks-plugin</artifactId>
<version>2.0.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.atlassian.webhooks</groupId>
<artifactId>atlassian-webhooks-api</artifactId>
<version>3.3.7</version>
<scope>provided</scope>
</dependency>
Below is part of the code to export webhooks(the import lines, the class initialization and the simplified code to just return the name of one of the webhooks)
import com.atlassian.jira.web.bean.TaskDescriptorBean;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.jira.plugins.webhooks.store.JiraWebHookListenerStore;
import com.atlassian.webhooks.api.register.listener.PersistentWebHookListener;
@Inject
public Exporter(
@Named("jiraWebHookListenerStore") final JiraWebHookListenerStore jiraWebHookListenerStore
) {
this.jiraWebHookListenerStore = jiraWebHookListenerStore;
}
@GET
@Path("webhooks")
@Produces(MediaType.APPLICATION_JSON)
public Response exportProjectConfiguration() throws Exception {
try {
String name = "";
Collection<PersistentWebHookListener> webhooks = jiraWebHookListenerStore.getAllWebHooks();
for (PersistentWebHookListener webhook: webhooks) {
name = webhook.getName();
break;
}
return Response.ok(new ExporterModel(name)).build();
catch (Exception e) {
throw e;
}
}
After I’ve compiled the plugin and started the Jira system, the error message is the following:
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] 2 plugins failed to load during Jira startup.
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] 'com.morganstanley.ai.jira-workflow-migrator' - 'jira-workflow-migrator' failed to load.
[INFO] [talledLocalContainer] Cannot start plugin: com.morganstanley.ai.jira-workflow-migrator
[INFO] [talledLocalContainer] Unable to resolve com.morganstanley.ai.jira-workflow-migrator [189](R 189.0): missing requirement [com.morganstanley.ai.jira-workflow-migrator [189](R 189.0)] osgi.wiring.package; (osgi.wiring.package=com.atlassian.jira.plugins.webhooks.store) Unresolved requirements: [[com.morganstanley.ai.jira-workflow-migrator [189](R 189.0)] osgi.wiring.package; (osgi.wiring.package=com.atlassian.jira.plugins.webhooks.store)]
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] Nov 25, 2022 8:43:28 PM org.apache.catalina.startup.HostConfig deployWAR
[INFO] [talledLocalContainer] INFO: Deployment of web application archive [C:\Users\yaoqih\Projects\jira-workflow-migrator\target\container\tomcat8x\cargo-jira-home\webapps\jira.war] has finished in [153,914] ms
[INFO] [talledLocalContainer] It was loaded from C:\Users\yaoqih\Projects\jira-workflow-migrator\target\jira\home\plugins\installed-plugins\jira-workflow-migrator-1.0.0-SNAPSHOT.jar
[INFO] [talledLocalContainer] Nov 25, 2022 8:43:28 PM org.apache.catalina.startup.HostConfig deployDirectory
[INFO] [talledLocalContainer] INFO: Deploying web application directory [C:\Users\yaoqih\Projects\jira-workflow-migrator\target\container\tomcat8x\cargo-jira-home\webapps\host-manager]
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] 'com.morganstanley.ai.jira-workflow-migrator-tests' - 'jira-workflow-migrator' failed to load.
Please kindly help me on this issue.
Regards,
Yaoqi Huang