Hi all,
I need to create an Jira issue by using REST API. I am trying to use UTL_HTTP package of ORACLE to post a HTTP request as follows:
DECLARE
req utl_http.req;
res utl_http.resp;
url varchar2(4000) := 'NAME/rest/api/3/issue';
name varchar2(4000);
buffer varchar2(4000);
content varchar2(4000) := '{
"update": {},
"fields": {
"summary": "Yapilmasi gereken isler",
"issuetype": {
"id": "10003"
},
"project": {
"id": "10000"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Is atamalari yapildi!!!",
"type": "text"
}]}]},
"reporter": {
"id": "5e9054cbacb63e0b8355a467"
},
"labels": [
"bugfix",
"blitz_test"
],
"assignee": {
"id": "5e9054cbacb63e0b8355a467"
}
}
} ';
begin
req := utl_http.begin_request(url, 'POST',' HTTP/1.1');
utl_http.set_header(req, 'Content-Type', 'application/json');
utl_http.set_header(req, 'user-agent', 'mozilla/4.0');
utl_http.set_header(req, 'Content-Length', length(content));
utl_http.set_header(req, 'Authorization', 'Basic C3xCPF0cFJaEUW48nqUsAEAC');
utl_http.write_text(req, content);
res := utl_http.get_response(req);
-- process the response from the HTTP call
begin
loop
utl_http.read_line(res, buffer);
dbms_output.put_line(buffer);
end loop;
utl_http.end_response(res);
exception
when utl_http.end_of_body
then
utl_http.end_response(res);
end;
end ;
I get 'PL/SQL procedure successfully completed.' result however issue is not created.
Can somebody help me?