如何使用 SOAP 获取 JIRA 多复选框自定义字段中的所有值?

发布于 2024-12-07 11:36:49 字数 104 浏览 0 评论 0原文

我正在开发一个使用 SOAP 与 JIRA 进行通信的 Web 应用程序。我有一个包含多个复选框的自定义字段,我可以通过 SOAP 获取该字段,但无法获取它包含的实际复选框。有办法做到这一点吗?

I'm developing a web application that uses SOAP to communicate with JIRA. I have a custom field that contains several checkboxes, and I can get this field through SOAP, but I can't get to the actual checkboxes it contains. Is there a way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

却一份温柔 2024-12-14 11:36:49

由于到目前为止还没有人回答这个问题,这里是我为 JIRA 所做的一些 JavaScript 的旧副本,阅读自定义字段。

var unitlist_val = $("#unitList_0").val();
var errorlist_val = $("#errorList_0").val();
var larmlist_val = $("#larmList_0").val();

var URL= ""+jira+"/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml jqlQuery=project+%3D+"+problem+
         "+AND+%22Symptom+1+-+Component%22+~+%22+"+unitlist_val+"%22+AND+%22Symptom+2+-+State%22+~+%22"+errorlist_val+
         "%22+AND+%22Symptom+3+-+alarm%22+~+%22"+larmlist_val+
         "%22&tempMax=1000&field=title&field=link&field=customfield_10422&field=customfield_10423&field=customfield_10424&field=customfield_10420&field=resolution&field=customfield_10440";

    $.ajax({
        type: "GET",
        url: URL,
        dataType: "xml",
        cache: false,
        beforeSend: function(request) {
            request.setRequestHeader("Accept", "text/xml; charset=utf-8");
        },
        success: function(data){
            $(data).find("item").each(function(){
                // Make sure swedish chars, are handled properly. Append to page first, then get value.
                var unitList = $("<div/>").html($(this).find("#customfield_10422 customfieldvalue").text()).text().split(",");
                var errorList = $("<div/>").html($(this).find("#customfield_10423 customfieldvalue").text()).text().split(",");
                var alarmList = $("<div/>").html($(this).find("#customfield_10424 customfieldvalue").text()).text().split(",");
                var knownerror = $("<div/>").html($(this).find("#customfield_10420 customfieldvalue").text()).text() || "None";
                var resolution = $("<div/>").html($(this).find("resolution").text()).text() || "None";
       }
    });

您也许可以在 Java 中执行类似的操作并使用简单的 GET 请求。我删掉了很多代码,所以有些部分可能有语法错误。

Since nobody has answered this so far, here is an old copy of some JavaScript I did for JIRA, reading customfields.

var unitlist_val = $("#unitList_0").val();
var errorlist_val = $("#errorList_0").val();
var larmlist_val = $("#larmList_0").val();

var URL= ""+jira+"/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml jqlQuery=project+%3D+"+problem+
         "+AND+%22Symptom+1+-+Component%22+~+%22+"+unitlist_val+"%22+AND+%22Symptom+2+-+State%22+~+%22"+errorlist_val+
         "%22+AND+%22Symptom+3+-+alarm%22+~+%22"+larmlist_val+
         "%22&tempMax=1000&field=title&field=link&field=customfield_10422&field=customfield_10423&field=customfield_10424&field=customfield_10420&field=resolution&field=customfield_10440";

    $.ajax({
        type: "GET",
        url: URL,
        dataType: "xml",
        cache: false,
        beforeSend: function(request) {
            request.setRequestHeader("Accept", "text/xml; charset=utf-8");
        },
        success: function(data){
            $(data).find("item").each(function(){
                // Make sure swedish chars, are handled properly. Append to page first, then get value.
                var unitList = $("<div/>").html($(this).find("#customfield_10422 customfieldvalue").text()).text().split(",");
                var errorList = $("<div/>").html($(this).find("#customfield_10423 customfieldvalue").text()).text().split(",");
                var alarmList = $("<div/>").html($(this).find("#customfield_10424 customfieldvalue").text()).text().split(",");
                var knownerror = $("<div/>").html($(this).find("#customfield_10420 customfieldvalue").text()).text() || "None";
                var resolution = $("<div/>").html($(this).find("resolution").text()).text() || "None";
       }
    });

You can probably do something similar in Java and use a simple GET request. I cut out quite a lot of code, so some parts might be syntax error on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文