Skip to content

Commit

Permalink
Add parent to issue structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vlladdrakk committed Apr 30, 2019
1 parent aff4197 commit 3a45d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions jiralib.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 4 additions & 3 deletions org-jira.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand All @@ -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))))))
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit 3a45d0f

Please sign in to comment.