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
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
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\\"])"]}
Hmm, what is your JIRA version?
7.3.3
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
It looks like you're new here. Sign in or register to get started.