Skip to content

Instantly share code, notes, and snippets.

@dgielis
Last active March 13, 2018 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgielis/d47b00e1d3d50d1bd0ecf93909f3d553 to your computer and use it in GitHub Desktop.
Save dgielis/d47b00e1d3d50d1bd0ecf93909f3d553 to your computer and use it in GitHub Desktop.
Load Oracle APEX Team Development into Bitbucket issues
declare
l_clob clob;
l_body clob;
begin
for r in (select feature_name as title, '*'||focus_area||'*' ||feature_description || ' ' || publishable_description || '' as description
from apex_team_features
where nvl(feature_status,0) < 100 and nvl(focus_area,'A') <> 'ON HOLD')
-- change where to what you need
loop
apex_json.initialize_clob_output;
apex_json.open_object;
apex_json.write(p_name => 'title', p_value => r.title);
apex_json.open_object(p_name => 'content');
apex_json.write(p_name => 'raw', p_value => r.description);
apex_json.close_object;
apex_json.close_object;
l_body := apex_json.get_clob_output;
apex_json.free_output;
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json';
l_clob := apex_web_service.make_rest_request(
p_url => 'https://api.bitbucket.org/2.0/repositories/owner/repo/issues',
p_http_method => 'POST',
p_username => 'xxx',
p_password => 'xxx',
p_body => l_body);
end loop;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment