-
Notifications
You must be signed in to change notification settings - Fork 0
/
jira_issue.body.sql
66 lines (49 loc) · 1.52 KB
/
jira_issue.body.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
create or replace package body jira_issue
as
procedure create_issue (
project in varchar2
, issuetype in varchar2
, summary in varchar2
, description in varchar2
, parent in varchar2 default null
)
as
build_json json := json();
temp_json json := json();
begin
jira.init_talk('issue/', 'POST');
if jira_help.is_number(project) then
temp_json.put('id', project);
else
temp_json.put('key', project);
end if;
build_json.put('project', temp_json);
if parent is not null then
temp_json := json();
if jira_help.is_number(parent) then
temp_json.put('id', parent);
else
temp_json.put('key', parent);
end if;
end if;
build_json.put('parent', temp_json);
build_json.put('summary', summary);
build_json.put('description', description);
temp_json := json();
if jira_help.is_number(issuetype) then
temp_json.put('id', issuetype);
else
temp_json.put('name', issuetype);
end if;
build_json.put('issuetype', temp_json);
jira.jira_call_request.call_json.put('fields', build_json);
jira.talk;
jira_help.jira_last_issue_id := json_ext.get_string(jira.jira_response_result.result, 'id');
jira_help.jira_last_issue_key := json_ext.get_string(jira.jira_response_result.result, 'key');
jira_help.jira_last_issue_ref := json_ext.get_string(jira.jira_response_result.result, 'self');
end create_issue;
begin
sys.dbms_application_info.set_client_info('jira_issue');
sys.dbms_session.set_identifier('jira_issue');
end jira_issue;
/