在执行Javascript代码时从Oracle Apex字段获取值并作为参数传递

问题描述

我对JavaScript完全陌生。下面的脚本用于从oracle apex页面在Jira(通过调用API)中添加注释。它的工作正常,但我也不能从顶点字段(P6_NEW2)接受注释文字(测试注释)。如果POST失败,如何获取任何返回代码

var usr=apex.item( "P6_NEW1" ).getValue ();
var data = JSON.stringify({"body": "**Test comment**"});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange",function () {
if (this.readyState === 4) {console.log('success'); }});
xhr.open("POST","https:xyz/rest/api/2/issue/QA123/comment");
xhr.setRequestHeader("authorization","Basic " + btoa(usr + ":" + usr));
xhr.setRequestHeader("content-type","application/json");
xhr.send(data);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)