Exemplo n.º 1
0
        internal JiraUser GetUser(string name)
        {
            JiraUser user;

            if (String.IsNullOrEmpty(name))
            {
                return(JiraUser.Unknown);
            }

            if (!_knownUsers.TryGetValue(name, out user))
            {
                if (_lookupUsers)
                {
                    _knownUsers.Add(name, user = new JiraUser(_service.getUser(_token, name)));
                }
                else
                {
                    _knownUsers.Add(name, user = new JiraUser(name, name));
                }

                _store.Write(GetType().FullName, user.Id, user.Name);
                _store.Write(GetType().FullName, ALL_USERS_KEY,
                             String.Join(";", new List <String>(_knownUsers.Keys).ToArray()));
            }

            return(user);
        }
Exemplo n.º 2
0
        private string getUserFullName(string user)
        {
            string fullname = null;

            if (user != null)
            {
                if (userCache.Contains(user))
                {
                    fullname = userCache[user].fullname;
                }
                else
                {
                    checkCredentials();
                    RemoteUser remoteUser = jira.getUser(credentials, user);
                    userCache.Add(user, remoteUser);
                    fullname = remoteUser.fullname;
                }
            }
            else
            {
                fullname = "Not assigned";
            }
            return(fullname);
        }