Ejemplo n.º 1
0
        public IActionResult CreateCase()
        {
            Company c = new Company()
            {
                TicketSysUrl      = "http://58.185.112.2:8550",
                TicketSysId       = "*****@*****.**",
                TicketSysPassword = Utility.ParseEInfo("DevS@b3r", _appSettings.General.SysInfo)
            };

            ClientCompany cl = new ClientCompany()
            {
                TicketSysCompanyCode = "124"
            };

            return(Ok(_caseMgmtService
                      .CreateCaseAsync(c, cl, $"Issue in test on {DateTime.Now.ToString("dd MMM yyyy")}",
                                       "I have an issue in my system. please HELPPPPP!!!").Result));
        }
Ejemplo n.º 2
0
        private async Task CreateJiraTicket()
        {
            // Search previous conversation
            var conversationList = _conversationService.GetConversationList($"{_senderInfo.senderConversationId}~{_company.FbPageId}");

            string jiraSummary     = conversationList.FirstOrDefault(x => x.LastQuestionAsked == (int)Question.IssueApplicationName).AnswerFreeText;
            string jiraDescription = conversationList.FirstOrDefault(x => x.LastQuestionAsked == (int)Question.IssueDescription).AnswerFreeText;

            // Search clients databases
            var clientList = _clientService.Get();

            // Jira integration here

            // Create Jira case
            List <TicketSysUser> ticketSysUserList = _jiraUserMgmtService.Get();
            var ticketSysUser = ticketSysUserList.Where(x => x.UserFbId == _senderInfo.senderConversationId).FirstOrDefault();

            var clientCompany = _clientService.GetById(ticketSysUser.ClientCompanyId);

            CaseDetail caseDetailResult = await _caseMgmtService.CreateCaseAsync(_company, clientCompany, $"{jiraSummary} [Create from FB ChatBot]", $"{jiraDescription}\n\n[Sent from FB ChatBot]");

            // If Jira case successfully created, inform user with case number
            await ConstructAndSendMessage(ConstructType.TicketCreated, caseDetailResult);
        }