Hi
I am trying to Integrate APEX with the JIRA Issue tracking Cloud platform, by testing my commands in CURL then in PLSQL using APEX_WEB_SERVICE.MAKE_REST_REQUEST.
I have a curl command to Assign a User to a JIRA Issue, from API reference :
https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-assign
curl -D- -u username:password -X PUT --data @ISSUE-999Assign.txt -H "Content-Type: application/json" https://mycompany.atlassian.net/rest/api/latest/issue/ISSUE_999/assignee
Contents of curl data file : ISSUE-999Assign.txt
{
"name": "Ade.Adekoya"
}
This works as expected by Assigning the Issue : ISSUE_999 with user : Ade.Adekoya
My PLSQL equivalent :
declare
L_json_response varchar2(15000);
begin
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).Value := 'application/json';
L_json_response := apex_web_service.make_rest_request
( p_url => 'https://mycompany.atlassian.net/rest/api/latest/issue/ISSUE_999/assignee'
, p_http_method => 'PUT'
, p_username => 'username'
, p_password => 'password'
, p_parm_name => apex_util.string_to_table('name')
, p_parm_value => apex_util.string_to_table('Ade.Adekoya')
, p_wallet_path => 'file:C:\TEMP\wallet'
, p_wallet_pwd => 'password1234'
);
dbms_output.put_line('This is L_json_response '|| L_json_response);
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
end;
This returns a response : Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN
What parameters should I be passing in which mimics the curl data file?? Or can I pass them in the URL??
Kind Regards
Ade