From 3a45d0f5063f5f705aa708891ea85825634d942c Mon Sep 17 00:00:00 2001 From: Thomas Tramley Date: Tue, 30 Apr 2019 08:59:39 -0300 Subject: [PATCH] Add parent to issue structure --- jiralib.el | 5 ++--- org-jira.el | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jiralib.el b/jiralib.el index 09e2451..1f2a890 100644 --- a/jiralib.el +++ b/jiralib.el @@ -892,12 +892,11 @@ Return nil if the field is not found" ISSUE is a Hashtable object." (jiralib-call "createIssue" nil issue)) -(defun jiralib-create-subtask (subtask parent-issue-id) +(defun jiralib-create-subtask (subtask) "Create SUBTASK for issue with PARENT-ISSUE-ID. SUBTASK is a Hashtable object." - (jiralib-call "createIssueWithParent" nil subtask parent-issue-id)) - + (jiralib-call "createIssueWithParent" nil subtask)) (defvar jiralib-subtask-types-cache nil) diff --git a/org-jira.el b/org-jira.el index f78e742..dd8fd54 100644 --- a/org-jira.el +++ b/org-jira.el @@ -1712,7 +1712,7 @@ that should be bound to an issue." 'org-jira-type-read-history (car org-jira-type-read-history))) -(defun org-jira-get-issue-struct (project type summary description) +(defun org-jira-get-issue-struct (project type summary description &optional parent-id) "Create an issue struct for PROJECT, of TYPE, with SUMMARY and DESCRIPTION." (if (or (equal project "") (equal type "") @@ -1725,6 +1725,7 @@ that should be bound to an issue." (ticket-struct `((fields (project (key . ,project)) + (parent (key . ,parent-id)) (issuetype (id . ,(car (rassoc type (if (and (boundp 'parent-id) parent-id) (jiralib-get-subtask-types) (jiralib-get-issue-types)))))) @@ -1766,8 +1767,8 @@ that should be bound to an issue." (equal summary "")) (error "Must provide all information!")) (let* ((parent-id (org-jira-parse-issue-id)) - (ticket-struct (org-jira-get-issue-struct project type summary description))) - (org-jira-get-issues (list (jiralib-create-subtask ticket-struct parent-id))))) + (ticket-struct (org-jira-get-issue-struct project type summary description parent-id))) + (org-jira-get-issues (list (jiralib-create-subtask ticket-struct))))) (defun org-jira-strip-string (str) "Remove the beginning and ending white space for a string STR."