Hi All,
I am trying to perform a transition of an issue from one state to another. At the same time I want to add a comment.
I checked several already asked questions: https://community.atlassian.com/t5/Jira-questions/How-to-change-the-issue-status-by-REST-API-in-JIRA/qaq-p/850658 but the solutions are not working for me.
My rest API:
def result = post("/rest/api/2/issue/${issueKey}/transitions")
.header('Content-Type', 'application/json')
.body([
update: [
comment: [
add:[
body: "added comment by script"
],
]
],
transition: [
id: 21]
])
.asString()
Error which I am facing is :
400: {"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@7b089630; line: 1, column: 12] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])"]}
Dear @anusha_s26 ,
your top-level object (and other objects, too) is an array. This is not API compliant. It has to look like:
{
update: {
...
}
transition: {
...
}
}
Have a look at the example.
So long
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.