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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.