public void Test_Put_Request_With_Issue()
        {
            _restSharpConnection.Authenticate("*****@*****.**", "mozart");
            dynamic issue = new Issue();

            issue.Summary          = "YT Test Issue";
            issue.Description      = "YT test description";
            issue.ProjectShortName = "NAT";
            var     comments = new List <Comment>();
            Comment comment  = new Comment();

            comment.Author    = "Meagan";
            comment.Text      = "comment added from apitest";
            issue.Comments    = comments;
            issue.Subsystem   = "Documentation";
            issue.Type        = "task";
            issue.Assignee    = "Meagan Combs";
            issue.Priority    = "Critical";
            issue.WorkHours   = 8;
            issue.CustomField = "customfield";
            issue.Created     = "";

            var fieldList = issue.ToExpandoObject();

            IssueManagement issueManagement = new IssueManagement(_restSharpConnection);

            //  var issueId = issueManagement.CreateIssue(issue);
            issueManagement.ApplyCommand("NAT-41", "Assignee Meagan_Combs", "");
            var issues = issueManagement.GetAllIssuesForProject("NAT");
        }
Esempio n. 2
0
        public void OnTimer(object sender, System.Timers.ElapsedEventArgs args)
        {
            lock (_sync)
            {
                _log.Debug("START FIND");
                _stopwatch.Start();

                try
                {
                    var iis = _issueManagement.GetAllIssuesForProject(PROJECT_IDENTIFICATOR, Int32.MaxValue,
                                                                      start: START_NUM_TASKS_FOR_FIND);
                    List <string> taskOfnitkin    = new List <string>();
                    List <string> taskOfdenneeeee = new List <string>();
                    List <string> taskOfsgmm      = new List <string>();
                    List <string> taskOfWlad      = new List <string>();

                    foreach (dynamic issue in iis)
                    {
                        if (issue.assigneeName == "nitkin")
                        {
                            taskOfnitkin.Add(issue.Id.ToString());
                        }
                        if (issue.assigneeName == "denneeeee")
                        {
                            taskOfdenneeeee.Add(issue.Id.ToString());
                        }
                        if (issue.assigneeName == "sgmm")
                        {
                            taskOfsgmm.Add(issue.Id.ToString());
                        }
                        if (issue.assigneeName == "Wlad-popow")
                        {
                            taskOfWlad.Add(issue.Id.ToString());
                        }
                    }

                    FindTask(taskOfnitkin, _dima, "");
                    //   FindTask(taskOfdenneeeee, _dima, "x"); TODO
                    //   FindTask(taskOfsgmm, _dima, "x");
                    //    FindTask(taskOfnitkin, _dima, "x");

                    _dima = taskOfnitkin;
                    _den  = taskOfdenneeeee;
                    _srg  = taskOfsgmm;
                    _wlad = taskOfWlad;

                    _stopwatch.Stop();
                    _log.Debug(_stopwatch.ElapsedMilliseconds);
                }
                catch (Exception ex)
                {
                    _log.Error(ex);
                    throw;
                }
            }
        }
Esempio n. 3
0
        protected override void OnStart(string[] args)
        {
            try
            {
                _sync = new object();

                FileInfo f = new FileInfo("log4net.config");
                log4net.Config.XmlConfigurator.Configure(f);
                _log = LogManager.GetLogger(typeof(Program));

                _log.Debug("OnStart");
                _connection = new Connection(HOST, port: PORT, useSSL: false, path: null);
                _connection.Authenticate(LOGIN, PASSWORD);

                _issueManagement = new IssueManagement(_connection);
                var iis = _issueManagement.GetAllIssuesForProject(PROJECT_IDENTIFICATOR, Int32.MaxValue, start: START_NUM_TASKS_FOR_FIND);
                foreach (dynamic issue in iis)
                {
                    if (issue.assigneeName == "nitkin")
                    {
                        _dima.Add(issue.Id.ToString());
                    }
                    if (issue.assigneeName == "denneeeee")
                    {
                        _den.Add(issue.Id.ToString());
                    }
                    if (issue.assigneeName == "sgmm")
                    {
                        _srg.Add(issue.Id.ToString());
                    }
                    if (issue.assigneeName == "Wlad-popow")
                    {
                        _wlad.Add(issue.Id.ToString());
                    }
                }

                _timer          = new System.Timers.Timer();
                _timer.Interval = 60000; // каждую минуту
                _timer.Elapsed += OnTimer;

                _timer.Start();
            }
            catch (Exception ex)
            {
                _log.Error(ex);
                throw;
            }
        }