tomolimo / processmaker

GLPI plugin that provides an interface with ProcessMaker (http://www.processmaker.com/)
30 stars 11 forks source link

Not allowing to add new project - Tasks #69

Closed vikijha closed 6 years ago

vikijha commented 6 years ago

Hi Tomolimo,

Once attached workflow with tickets its not allowing to add Projects-tasks on same ticket. When i click on projects tab in GLPI showing below error

You must manage it first (see 'Process - Case' tab)!

tomolimo commented 6 years ago

Hello @vikijha Thank you for your report Could it be possible for you to list the steps that lead to the issue? And to look into the logs if any errors can be found there? Thank you Regards Tomolimo

vikijha commented 6 years ago

I created New ticket from assistance menu In Process cases selected workflow and add Then went to ticket projects tab where its showing You must manage it first (see 'Process - Case' tab)!

tomolimo commented 6 years ago

Hello @vikijha Could you remind me the version of GLPI you are using? Thank you Regards, Tomolimo

tomolimo commented 6 years ago

With version GLPI 9.1.x: the root cause of this issue is here: https://github.com/glpi-project/glpi/blob/9aba97a6c760489d863f0c2e4f963ed42f23b6d1/inc/projecttask_ticket.class.php#L277

vikijha commented 6 years ago

I am using 9.2.x

tomolimo commented 6 years ago

Hello @vikijha, Could you check if there is any error in the log files? Thank you Regards, Tomolimo

vikijha commented 6 years ago

I am not getting any error in log files either on glpi or processmaker

tomolimo commented 6 years ago

Hello @vikijha I checked in the GLPI sources, and this feature has only been added in the 9.2.3 release, could you tell me which release of 9.2 you are using? See: https://github.com/glpi-project/glpi/issues/3665 Thank you, Regards, Tomolimo

tomolimo commented 6 years ago

Hello @vikijha I just made a test with GLPI 9.2.3 and PM plugin 3.3.0 beta (from master branch) and here is the screencopy for this:

image

Yes there is a warning that should not be here, but nevertheless, I've been able to add a project task to the ticket.

Thank you Regards, Tomolimo

vikijha commented 6 years ago

Let me setup new glpi and try this.

tomolimo commented 6 years ago

could you tell me which release of 9.2 you are using?

tomolimo commented 6 years ago

Hello @vikijha Any news? Thank you, Regards, Tomolimo

shahmilan34 commented 6 years ago

Hello @vikijha @tomolimo I was facing same issue in change and problem. Error "You must manage it first (see 'Process - Case' tab)!" is coming because it does'nt have permission GLPI_ITEM_CAN_BE_SOLVED .

There are two solution i found:

  1. In processmaker-server process define trigger : @@GLPI_ITEM_CAN_BE_SOLVED=1;
  2. Bypass canSolve for change and problem: Go to processmaker/inc/case.class.php in canSolve function Replace if ($myCase->fields['case_status'] != 'COMPLETED' && $myCase->fields['case_status'] != 'CANCELLED' && (!isset($pmVar['GLPI_ITEM_CAN_BE_SOLVED']) || $pmVar['GLPI_ITEM_CAN_BE_SOLVED'] != 1) ) With if ($myCase->fields['case_status'] != 'COMPLETED' && $myCase->fields['case_status'] != 'CANCELLED' && (!isset($pmVar['GLPI_ITEM_CAN_BE_SOLVED']) || $pmVar['GLPI_ITEM_CAN_BE_SOLVED'] != 1) && !preg_match('/(Change)|(Problem)/i', $item["options"]['itemtype']))

Glpi 9.2.4 ProcessMaker Plugin 3.2.8 ProcessMaker-Server 3.0.1.8

Thank you Regards Milan

tomolimo commented 6 years ago

Hello @shahmilan34 , @vikijha

GLPI_ITEM_CAN_BE_SOLVED is only to be used when you need to solve a ticket when some process tasks are not yet done. Use case: imagine a Release management process (this use case is running in our company), and imagine that the last task of the process is a PIR task (it's a review of the change and release process), and that to be able to do this review, you need to have the end-user satisfaction survey. For this you need to have the ticket solution set, and approved by the end-user, and then after the survey, you want to be able to do the last process task. This task can not be done before the close of the ticket. And by design you don't want to be able to solve tickets if tasks are still 'to do'. Then that's the purpose of this case variable: see https://github.com/tomolimo/processmaker/wiki/Case-Variables

I think I've found the root cause of the issue: there is a query used to determined if 'to_do' tasks are still open, and this query is hard-coding the glpi_tickettasks table: that is even if you are using a Change or a Problem, it's looking at tickettasks, and not at problemtasks or changetasks.

I'm going to fix this in the 3.3.0 release,

Thank you, Regards, Tomolimo

tomolimo commented 6 years ago

Fixed by 60beb4cca00d4d160e1af42233a8b35ccc2b9fb1