Пример #1
0
 /// <summary>
 ///     Sets the custom field values.
 /// </summary>
 /// <param name="workItem"></param>
 /// <param name="fieldValueAssociation"></param>
 public static void SetCustomFieldValues(TrackerService.WorkItem workItem, Dictionary <string, object> fieldValueAssociation)
 {
     foreach (KeyValuePair <string, object> keyValuePair in fieldValueAssociation)
     {
         TrackerService.Custom custom = workItem.customFields.Where(x => x.key == keyValuePair.Key).FirstOrDefault();
         if (custom != null)
         {
             custom.value = keyValuePair.Value;
         }
     }
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="customField"></param>
        /// <returns></returns>
        public static string GetTextFromHtmlTextField(TrackerService.Custom customField, bool stripHtml = true)
        {
            string text = ((TrackerService.Text)(customField.value)).content;

            if (stripHtml)
            {
                text = HtmlHelper.StripHtml(text);
            }

            return(text);
        }
Пример #3
0
 /// <summary>
 ///     Gets the field content.
 /// </summary>
 /// <param name="customField"></param>
 /// <returns></returns>
 public static string GetFieldContent(TrackerService.Custom customField)
 {
     return(((TrackerService.Text)(customField.value)).content);
 }