I am trying to get a copy of project from specific subgroup and create new project with this copy in another subgroup under the same group. note:- I suppose to know the path for the target project to be created from variables I will get from database so I cannot use subgroup id directly.
var project = gitLabApi.getGroupApi().getGroup("parent-group/subgroup1/sub2/sub3/lastSubgroup").getProjects().get(0);
Here I got the project correctly. my issue with copying it in another subgroup path
gitLabApi.getProjectApi().createProject("testname",gitLabApi.getGroupApi().getGroup("parent-group/targetsubgroup1/targetsub2/../targetlastSubgroup").getPath()).setForkedFromProject(project);
It runs the command but I cannot see any forked project created. when I add the path as string path I get validation error in path.
Itried also
Project newProject = gitLabApi.getProjectApi().forkProject(project.getId(),gitLabApi.getGroupApi().getGroup("parent-group/targetsubgroup1/targetsub2/../targetlastSubgroup").getProjects().get(0).getNamespace().getName(),gitLabApi.getGroupApi().getGroup("parent-group/targetsubgroup1/targetsub2/../targetlastSubgroup","projnameSara");
I got 404 not found namespace
I find the solution for my issue.