// GET: api/WorkItems
        public IHttpActionResult Get()
        {
            var test = new TfsService();

            var results = test.GetWorkItemsForUser("*****@*****.**");

            return(this.Ok(results));
        }
        private static void MenuItemCallback(object sender, EventArgs e)
        {
            var dte = (DTE2)Package.GetGlobalService(typeof(SDTE));

            dte.UndoContext.Open("ctx", false);
            try
            {
                List <ProjectItem> projectItems = TfsService.GetPendingChanges();
                foreach (var projectItem in projectItems)
                {
                    AddArgumentNullChecksToContructors.Execute(projectItem);
                }
            }
            finally
            {
                dte.UndoContext.Close();
            }
        }
예제 #3
0
파일: WorkItem.cs 프로젝트: Olezhka/Hipbot
        public override void Receive(Message message, Room room, Options options)
        {
            string tfsUri, collectionName;

            TfsService.GetUserConfig(message.From, out tfsUri, out collectionName);

            var result = TfsService.RetrieveWorkItem(message.From, tfsUri, options.Collection ?? collectionName, options.Item);

            if (result == null)
            {
                HipChatService.Say(room, "Could not find work item");
            }
            else
            {
                var wiResourceUri = result.Project.Uri;
                var uri           = string.Format("{0}/web/UI/Pages/WorkItems/WorkItemEdit.aspx?id={1}&pguid={2}", tfsUri, result.Id, wiResourceUri.Segments.Last());
                var info          = string.Format("<a href=\"{5}\">{1} ({0})</a><br/>Type: {2}<br/>State: {3}<br/>Assigned To: {4}", result.Id, result.Title, result.Type.Name, result.State, result.Fields["System.AssignedTo"].Value, uri);
                room = RoomService.GetRoomByJabberId(room.JabberId);

                HipChatService.SayHtml(room, info);
            }
        }