Exemplo n.º 1
0
        /// <summary>
        ///     Retrieve the estimation (story points) from the issue, this only works by using the BoardConfiguration
        /// </summary>
        /// <typeparam name="T">Type for the estimation</typeparam>
        /// <param name="boardConfiguration">BoardConfiguration</param>
        /// <returns>T or default(T) if there is no value</returns>
        public T GetEstimation <T>(BoardConfiguration boardConfiguration)
        {
            if (boardConfiguration == null)
            {
                throw new ArgumentNullException(nameof(boardConfiguration));
            }
            // Get the custom estimation field ID
            var estimationCustomField = boardConfiguration.Estimation.Field.FieldId;

            // check if there is a custom field for the ID
            if (!Fields.CustomFields.ContainsKey(estimationCustomField))
            {
                return(default);
Exemplo n.º 2
0
        /// <summary>
        ///     Retrieve the rank from the issue, this only works by using the BoardConfiguration
        /// </summary>
        /// <param name="boardConfiguration">BoardConfiguration</param>
        /// <returns>Something which represents a rank</returns>
        public string GetRank(BoardConfiguration boardConfiguration)
        {
            if (boardConfiguration == null)
            {
                throw new ArgumentNullException(nameof(boardConfiguration));
            }
            var rankCustomField = $"customfield_{boardConfiguration.Ranking.RankCustomFieldId}";

            if (!Fields.CustomFields.ContainsKey(rankCustomField))
            {
                return(null);
            }
            return((string)Fields.CustomFields[rankCustomField]);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Retrieve the estimation (story points) from the issue, this only works by using the BoardConfiguration
        /// </summary>
        /// <typeparam name="T">Type for the estimation</typeparam>
        /// <param name="boardConfiguration">BoardConfiguration</param>
        /// <returns>T or default(T) if there is no value</returns>
        public T GetEstimation <T>(BoardConfiguration boardConfiguration)
        {
            if (boardConfiguration == null)
            {
                throw new ArgumentNullException(nameof(boardConfiguration));
            }
            // Get the custom estimation field ID
            var estimationCustomField = boardConfiguration.Estimation.Field.FieldId;

            // check if there is a custom field for the ID
            if (!Fields.CustomFields.ContainsKey(estimationCustomField))
            {
                return(default(T));
            }

            // We have a custom field, get it
            var result = Fields.CustomFields[estimationCustomField];

            // Return the custom field, as the supplied type
            return(result == null ? default(T) : (T)result);
        }
Exemplo n.º 4
0
 /// <summary>
 ///     Retrieve the estimation (story points) from the issue, this only works by using the BoardConfiguration
 ///     This is a conveniance method for the generic GetEstimation and assumes a long
 /// </summary>
 /// <param name="boardConfiguration">BoardConfiguration</param>
 /// <returns>long with estimation or 0 if nothing</returns>
 public long GetEstimation(BoardConfiguration boardConfiguration)
 {
     return(GetEstimation <long>(boardConfiguration));
 }