Dear Community,
I would like to update an existing issue. I use following REST Call:
curl -u admin:admin -s -X PUT --data '{"fields":{"fixVersions":[{"version":"1.8.0"}]}}' -H 'Content-Type: application/json' https://jira/rest/api/2/issue/ISSUE-1
The response is empty. What am I doing wrong?
Thanks
Darius
The JSON needs to be like this:
let JiraClient = require("jira-connector");
let labels = ["label1", "label2", "label3", "label4"];
let jiraIssueLabels = [];
let fixVersionsLabels = [ {"add" : {"name" : "release_TEST"}} ];
labels.forEach(label => jiraIssueLabels.push({"add": label}));
let bodyData = { issueId: `ENG-224`,
issue: {
update: {
labels: jiraIssueLabels,
fixVersions: fixVersionsLabels
}
}
};
jira.issue.editIssue(bodyData);
More simply:
{
issueId: `ENG-224`,
issue: {
update: {
fixVersions: [ {"add" : {"name" : "release_TEST"}} ]
}
}
}
Note: the fixVersions value (ex: release_TEST) must already exist in Jira to work
Try this:
curl -D- -u admin:admin -X PUT --data '{"update":{"fixVersions":[{"set": [ {"name":"1.8.0"} ] }]}}' -H "Content-Type: application/json" https://jira/rest/api/2/issue/ISSUE-1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am sorry, but this call is not working.
{"errorMessages":["Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\\n at [Source: org.apache.catalina.connector.CoyoteInputStream@3956ce; line: 1, column: 12] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\\"update\\"])"]}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, what is your JIRA version?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This works for me. However, it overwrote the existing values. What option to use for appending the new value instead?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.