/// <summary>
 /// Create a new Issue with a name.
 /// </summary>
 /// <param name="name">The initial name of the entity.</param>
 /// <param name="project">The Project this Issue will be in.</param>
 /// <param name="attributes">Required attributes.</param>
 /// <returns>A newly minted Issue that exists in the VersionOne system.</returns>
 public Issue Issue(string name, Project project, IDictionary<string, object> attributes) {
     var issue = new Issue(instance) {
         Name = name, 
         Project = project
     };
     AddAttributes(issue, attributes);
     issue.Save();
     return issue;
 }
 /// <summary>
 /// Creates an Issue related to a Retrospective
 /// </summary>
 /// <param name="name">The name of the Issue</param>
 /// <param name="retrospective">The Retrospective to relate the Issue to</param>
 /// <param name="attributes">Required attributes.</param>
 /// <returns>The newly saved Issue</returns>
 public Issue Issue(string name, Retrospective retrospective, IDictionary<string, object> attributes) {
     var issue = new Issue(instance) {
         Name = name, 
         Project = retrospective.Project
     };
     AddAttributes(issue, attributes);
     issue.Save();
     //TODO verify sequence
     issue.Retrospectives.Add(retrospective);
     return issue;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Index an issue
        /// </summary>
        /// <param name="issue">issue to index</param>
        private void Index(Issue issue)
        {
            Document doc = CreateDocument(issue);
            if(null != issue.Owner)
            {
                doc.Add(UnStored("Owner", issue.Owner.Name));
                doc.Add(UnStored("OwnerId", issue.Owner.Username));
            }

            doc.Add(UnStored("Reference", issue.Reference));
            if(null != issue.Priority)
                doc.Add(UnStored("Priority", issue.Priority.CurrentValue));
            if(null != issue.IdentifiedBy)
                doc.Add(UnStored("Source", issue.Source.CurrentValue));

            doc.Add(UnStored("IdentifiedBy", issue.IdentifiedBy));

            doc.Add(UnStored("ResolutionDetails", issue.ResolutionDetails));
            if(null != issue.ResolutionReason)
                doc.Add(UnStored("ResolutionReason", issue.ResolutionReason.CurrentValue));

            if(null != issue.Type)
                doc.Add(UnStored("Type", issue.Type.CurrentValue));

            _luceneIndexWriter.AddDocument(doc);
        }