예제 #1
0
        public TfsWorkItem GetWorkItem(int workItemId)
        {
            return _cacheClient.GetFromCacheOrFunc(workItemId.ToString(CultureInfo.InvariantCulture), key =>
                {
                    if (_connection == null) Connect();

                    if (_connection != null)
                    {
                        var workItemStore = _connection.GetService<WorkItemStore>();

                        var workItem = workItemStore.GetWorkItem(workItemId);

                        var result = new TfsWorkItem
                            {
                                Id = workItem.Id,
                                Title = workItem.Title,
                                Type = workItem.Type.Name,
                                State = workItem.State,
                                Created = workItem.CreatedDate,
                                Description = workItem.Description,
                                ParentId = GetParentId(workItem),
                                ChildrenIds = GetChildrenIds(workItem),
                                HistoryComments = workItem.Revisions.Cast<Revision>().Select(r => r.Fields[CoreField.History].Value.ToString()).ToList()
                            };

                        return result;
                    }
                    //TODO Throw a better error?
                    return null;
                });
        }
        private ExternalIssueDetails GetDetails(TfsWorkItem wi)
        {
            var eid = new ExternalIssueDetails
            {
                Id = wi.Id.ToString(),
                Created = wi.Created.ToString("dd-MM-yyyy HH:mm:ss"),
                Comments = wi.HistoryComments,
                Status = wi.State,
                Summary = wi.Title,
                Description = wi.Description,
            };

            return eid;
        }
예제 #3
0
 private Issue GetIssueFromTfsWorkItem(TfsWorkItem wi)
 {
     return new Issue
     {
         Id = wi.Id.ToString(),
         Url = _tfsApi.ConnectionUri + "/web/wi.aspx?id=" + wi.Id
     };
 }
        private ExternalIssueDetails GetDetails(TfsWorkItem wi)
        {
            var eid = new ExternalIssueDetails
            {
                Id = wi.Id.ToString(CultureInfo.InvariantCulture),
                Created = wi.Created.ToString("dd-MM-yyyy HH:mm:ss"),
                Type = wi.Type,
                Comments = wi.HistoryComments,
                Status = wi.State,
                Summary = wi.Title,
                Description = wi.Description,
                LastAssignedTo = wi.LastAssignedTo,
            };

            return eid;
        }