CREATE DEFINER=`NGIOne_Dev`@`%` PROCEDURE `SP_UpdateAction`(
IN A_LoginUserID varchar(36),
IN A_ActionID varchar(36),
IN A_ActionCode varchar(50),
IN A_AssignedUserID varchar(50),
IN A_AssignedProjectID varchar(50),
IN A_ActionStatusCode varchar(50),
IN A_ActionEndDate varchar(50),
IN A_LastActionComment varchar(512),
IN T_EstimatedHrs double(10,2)
)
BEGIN
declare varStoryID varchar(100);
declare varSprintName varchar(100);
update tbl_action set
ActionCode= A_ActionCode,
AssignedUserID=A_AssignedUserID,
AssignedProjectID=A_AssignedProjectID,
ActionStatusCode=A_ActionStatusCode,
ActionEndDate=STR_TO_DATE(A_ActionEndDate,'%Y/%m/%d %H:%i'),
LastActionComment=A_LastActionComment,
ModifiedOn = Now()
where ActionID=A_ActionID;
if(A_ActionStatusCode="Task Created")then
select ts.StoryID,tbsp.SprintName
into varStoryID,varSprintName
from tbl_sprint tbsp
inner join tbl_story ts on tbsp.SprintID
COLLATE utf8_unicode_ci= ts.Sprint COLLATE utf8_unicode_ci
where tbsp.Project COLLATE utf8_unicode_ci= A_AssignedProjectID
order by tbsp.CreatedOn and ts.Title = '95 - Action item' desc limit 1;
-- select varStoryID,varSprintName;
set A_AssignedUserID = Concat("'",A_AssignedUserID,"'");
-- select A_AssignedUserID;
call SP_AddTask(A_LastActionComment,varStoryID,A_LastActionComment,A_AssignedUserID,
'Not started','High',varSprintName,A_AssignedProjectID,
'','',A_LastActionComment,A_LoginUserID,
T_EstimatedHrs,T_EstimatedHrs,1,0);
end if;
END