Exemple #1
0
 /// <summary>
 /// Create an issue link.
 /// </summary>
 /// <param name="jira">The Jira class.</param>
 /// <param name="issueLinkType">Issue link type.</param>
 /// <param name="inwardIssueKey">Issue key of the inward issue.</param>
 /// <param name="outwardIssueKey">Issue key of the outward issue.</param>
 /// <param name="comment">A comment created with the link.</param>
 /// <returns>The task object representing the asynchronous operation.</returns>
 public static async Task CreateIssueLinkAsync(this Jira jira, IssueLinkType issueLinkType, string inwardIssueKey, string outwardIssueKey, string comment = null)
 {
     //IssueLink link = new IssueLink();
     //link.Type = issueLinkType;
     //link.Comment = string.IsNullOrEmpty(comment) ? null : new Comment() { Body = "comment" };
     //link.InwardIssue = new Issue(inwardIssueKey);
     //link.OutwardIssue = new Issue(outwardIssueKey);
     //await jira.CreateIssueLinkAsync(link);
     await jira.CreateIssueLinkAsync(issueLinkType, new Issue(inwardIssueKey), new Issue(outwardIssueKey), comment);
 }
Exemple #2
0
        /// <summary>
        /// Create an issue link
        /// </summary>
        /// <param name="jira">The Jira class.</param>
        /// <param name="issueLinkType">Issue link type.</param>
        /// <param name="inwardIssue">The inward issue.</param>
        /// <param name="outwardIssue">Teh outward issue.</param>
        /// <param name="comment">A comment created with the link.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public static async Task CreateIssueLinkAsync(this Jira jira, IssueLinkType issueLinkType, Issue inwardIssue, Issue outwardIssue, string comment = null)
        {
            IssueLink link = new IssueLink();

            link.Type    = issueLinkType;
            link.Comment = string.IsNullOrEmpty(comment) ? null : new Comment()
            {
                Body = "comment"
            };
            link.InwardIssue  = inwardIssue;
            link.OutwardIssue = outwardIssue;
            await jira.CreateIssueLinkAsync(link);
        }
Exemple #3
0
        /// <summary>
        /// Create an issue link.
        /// </summary>
        /// <param name="jira">The Jira class.</param>
        /// <param name="issueLinkTypeName">Name of the link type.</param>
        /// <param name="inwardIssueKey">Key of the inward issue.</param>
        /// <param name="outwardIssueKey">Key of the outward issue.</param>
        /// <param name="comment">Comment to add.</param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public static async Task CreateIssueLinkAsync(this Jira jira, string issueLinkTypeName, string inwardIssueKey, string outwardIssueKey, string comment = null)
        {
            IEnumerable <IssueLinkType> issueLinkTypes = await jira.GetIssueLinkTypesAsync();

            IssueLinkType issueLinkType = issueLinkTypes.Where(t => t.Name == issueLinkTypeName).FirstOrDefault();

            //IssueLink link = new IssueLink();
            //link.Type = issueLinkTypes.Where(t => t.Name == issueLinkTypeName).FirstOrDefault();
            //link.Comment = string.IsNullOrEmpty(comment) ? null : new Comment() { Body = "comment" };
            //link.InwardIssue = new Issue(inwardIssueKey);
            //link.OutwardIssue = new Issue(outwardIssueKey);
            //await jira.CreateIssueLinkAsync(link);

            await jira.CreateIssueLinkAsync(issueLinkType, inwardIssueKey, outwardIssueKey, comment);
        }