You are not logged in.
Pages: 1
Hi!
Trying to use DataInjection plugin for import data from CSV. Success in import Software, Users. Computers...
But can't import project and project tasks. Could somebody advise how to do it?
Thanx in advance!
Last edited by romVsen (2023-01-26 08:28:27)
Offline
Import of Projects and Project Tasks is currently not implemented for this plugin.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Online
Import of Projects and Project Tasks is currently not implemented for this plugin.
Thank you! Is it possible by REST API (from documentation):
URL: apirest.php/:itemtype/
Description: Add an object (or multiple objects) into GLPI.
Method: POST
Offline
cconard96 wrote:Import of Projects and Project Tasks is currently not implemented for this plugin.
Thank you! Is it possible by REST API (from documentation):
URL: apirest.php/:itemtype/
Description: Add an object (or multiple objects) into GLPI.
Method: POST
OK, really it's possible to add project(s) by /apirest.php/Project/ and provided JSON with projects attributes (don't forget to use POST instead of PUT).
But it seems there is a problem for ProjectTask. I can get list of all projects by GET /apirest.php/Project/. But it doesn't work for tasks: GET request /apirest.php/ProjectTask/ returns empty array. Can somebody explain how to add tasks to project by REST API?
Last edited by romVsen (2023-01-27 01:01:34)
Offline
Hi!
Can somebody explain is it possible to add ProjectTasks to Project by REST API?
Offline
I cannot recreate the issue you mentioned previously. Please make sure you are using the correct profile and in the correct entity if the user you are authenticating as has multiple profiles/entities.
I can get all project tasks from the URL you specified.
When adding a Project Task, you can use the same URL but just change the method to POST and include the projects_id to specify which project you want to add it to.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Online
I cannot recreate the issue you mentioned previously. Please make sure you are using the correct profile and in the correct entity if the user you are authenticating as has multiple profiles/entities.
I can get all project tasks from the URL you specified.
When adding a Project Task, you can use the same URL but just change the method to POST and include the projects_id to specify which project you want to add it to.
cconard96, thank you! But I cant solve the problem.
More detailed description below
I have created several Projects and ProjectTasks by user glpi.
User glpi an Entity exist from installation (I didn't add them by myself). User glpi has Super-Admin profile. Additionally, I added Super-Admin profile as Default profile for user glpi.
So,
1. I get a Session-Token by /apirest.php/initSession/ with user glpi credentials.
2. I use /apirest.php/ProjectTask/ with Session-Token above
As a result I get empty list.
Then I added user glpi in Project Team for several Project. Only that ProjectTasks I can get by /apirest.php/ProjectTask/. The same list I can see (for user glpi) in Project - > My Tasks (/front/projecttask.php) .
As far as user glpi has Super-Admin profile I expect to get all ProjectTasks without adding it to the ProjectTeam of the Project. Can you explain how to do it?
Thank you!
Offline
Oh... I remember this issue now.
Sorry. On my developer instance of GLPI, the glpi account was on the team for most of the tasks so I missed it.
Since the only way to view tasks on their own (not within the form of a project) is the "My Tasks" button, there is a hack in the Search engine that forces a search for Project Tasks to only include ones that the current user is in the team for.
This is not something that can be overriden and the current API uses the same Search engine.
Good news and bad news though.
The bad news is I don't know if a workaround can be added cleanly for the current API.
The good news is we are adding a more user-friendly API in the next major release (10.1) that doesn't rely on the current Search code, so there shouldn't be any unexpected behaviors like this.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Online
Well, can I perform mass adding of specified user in Project Team for all Projects? Can you recommend something? Maybe direct update in the db table for Projects?
A little clarification: it is needed to set ProjectTeam in each ProjectTask. To set ProjectTeam in each Project is not enough.
It seems the only way to make that bulk setting is to manually update table glpi_projecttaskteams. It is very awkward.
Last edited by romVsen (2023-04-10 10:36:05)
Offline
Pages: 1