创建时的Jira Cloud Scriptrunner链接问题

时间:2018-10-04 18:09:33

标签: jira jira-rest-api

我正在处理产生问题的Jira工作流发布功能。我试图添加更新,以便在创建新问题时也将其链接到原始问题。

当我运行它时,此错误不断出现

  

CorrelationId:222dcd7a-b781-45f8-982d-da4dc4196fdd   RUN脚本标识符:a1fdfe6b-47f6-49c2-bb94-26a7a9014c0f   com.adaptavist.sr.cloud.workflow.RunScript(针对问题HR-460进行了“离线”转换):3500ms日志:   2018-10-04 17:52:54.886警告-对/ rest / api / 2 / issue的POST请求返回了错误代码:状态:400-错误的请求   正文:{“ errorMessages”:[“无法在[来源:com.atlassian.plugin.connect.plugin.auth.scope.InputConsumingHttpServletRequest$1@1e96084e;的行:START_OBJECT令牌中反序列化java.util.ArrayList的实例\ n 1,列:151](通过参考链:com.atlassian.jira.rest.v2.issue.IssueUpdateBean [\“ update \”])“]}   2018-10-04 17:52:54.928信息-POST / rest / api / 2 / issue asString请求持续时间:1902ms   2018-10-04 17:52:54.929信息-运行脚本已完成

这就是我正在运行的

def sourceSummary = issue.fields.summary
def exitDate = issue.fields.customfield_13200
def sourceKey = issue.key


post("/rest/api/2/issue") 
.header("Content-Type", "application/json")
.body(
    [
            fields: 
            [
                    "summary"    : sourceSummary,
                    "customfield_13200" : exitDate,
                    "security" : [ "id" : "10101"],

                    "project"    : [
                            "id": "10001"
                    ],
                    "issuetype"  : [
                            "id": "12550"
                    ]
            ],
            "update":[
                "issuelinks":
                [
                    "add":[
                        "type":[
                            "name":"Relates",
                            "inward":"relates to",
                            "outward":"relates to"
                        ],
                        "outwardIssue":[
                            "key":sourceKey
                        ]
                    ]
                ]
            ]
    ])
.asString()

我对此很陌生,从其他帖子中我已经看到这应该可行。任何指针将不胜感激。

0 个答案:

没有答案