Im working on a Jira workflow post function that creates an issue. Im trying to add an update so that when it creates the new issue it also links it to the original issue.
When I run it this error keeps coming back
CorrelationId: 222dcd7a-b781-45f8-982d-da4dc4196fdd RUN Script identifier: a1fdfe6b-47f6-49c2-bb94-26a7a9014c0f com.adaptavist.sr.cloud.workflow.RunScript ('Off-Board' transition made for issue HR-460) Took: 3500ms Logs: 2018-10-04 17:52:54.886 WARN - POST request to /rest/api/2/issue returned an error code: status: 400 - Bad Request body: {"errorMessages":["Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: com.atlassian.plugin.connect.plugin.auth.scope.InputConsumingHttpServletRequest$1@1e96084e; line: 1, column: 151] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])"]} 2018-10-04 17:52:54.928 INFO - POST /rest/api/2/issue asString Request Duration: 1902ms 2018-10-04 17:52:54.929 INFO - Run script completed
This is the code im running
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()<br><br> Im pretty new to this and from other posts Ive seen this should work. Any pointers would be appreciated.