Skip to content

Commit d62c5a9

Browse files
Dmitrij DjachkovDmitriy Dyachkov
andauthored
JIRA: add 'update' property to create_issue (#695)
Co-authored-by: Dmitriy Dyachkov <d_dyachkov@wargaming.net>
1 parent b4eff0b commit d62c5a9

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

atlassian/jira.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,22 +885,37 @@ def assign_issue(self, issue, assignee=None):
885885

886886
return self.put(url, data=data)
887887

888-
def create_issue(self, fields, update_history=False):
888+
def create_issue(self, fields, update_history=False, update=None):
889889
"""
890890
Creates an issue or a sub-task from a JSON representation
891891
:param fields: JSON data
892892
mandatory keys are issuetype, summary and project
893+
:param update: JSON data
894+
Use it to link issues or update worklog
893895
:param update_history: bool (if true then the user's project history is updated)
894896
:return:
895897
example:
896898
fields = dict(summary='Into The Night',
897899
project = dict(key='APA'),
898900
issuetype = dict(name='Story')
899901
)
900-
jira.create_issue(fields=fields)
902+
update = dict(issuelinks={
903+
"add": {
904+
"type": {
905+
"name": "Child-Issue"
906+
},
907+
"inwardIssue": {
908+
"key": "ISSUE-KEY"
909+
}
910+
}
911+
}
912+
)
913+
jira.create_issue(fields=fields, update=update)
901914
"""
902915
url = "rest/api/2/issue"
903916
data = {"fields": fields}
917+
if update:
918+
data["update"] = update
904919
params = {}
905920

906921
if update_history is True:

0 commit comments

Comments
 (0)