diff --git a/core/src/main/java/hudson/model/ItemGroupMixIn.java b/core/src/main/java/hudson/model/ItemGroupMixIn.java index 2a6b264db9de..faa214dee621 100644 --- a/core/src/main/java/hudson/model/ItemGroupMixIn.java +++ b/core/src/main/java/hudson/model/ItemGroupMixIn.java @@ -290,6 +290,7 @@ public synchronized TopLevelItem createProjectFromXML(String name, InputStream x add(result); + result.onCreatedFromScratch(); ItemListener.fireOnCreated(result); Jenkins.get().rebuildDependencyGraphAsync(); diff --git a/test/src/test/java/jenkins/model/RunIdMigratorTest.java b/test/src/test/java/jenkins/model/RunIdMigratorTest.java index 4ade1afc84e1..cb7903435d80 100644 --- a/test/src/test/java/jenkins/model/RunIdMigratorTest.java +++ b/test/src/test/java/jenkins/model/RunIdMigratorTest.java @@ -39,7 +39,6 @@ import java.nio.charset.StandardCharsets; import org.htmlunit.HttpMethod; import org.htmlunit.WebRequest; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.Issue; @@ -58,7 +57,6 @@ public void legacyIdsPresent() throws Exception { assertTrue(legacyIds.exists()); } - @Ignore("TODO Item#onCreatedFromScratch is not called") @Issue("JENKINS-64356") @Test public void legacyIdsPresentViaRestApi() throws Exception { @@ -82,7 +80,6 @@ public void legacyIdsPresentViaRestApi() throws Exception { assertTrue(legacyIds.exists()); } - @Ignore("TODO Item#onCreatedFromScratch is not called") @Issue("JENKINS-64356") @Test public void legacyIdsPresentViaCli() {