0

I'm trying to add fixVersions value for a stroy and change the status in the story of JIRA using REST API and getting error in for the request call

Info : Added the proper credentials

Req 1 - To set fixVersions :

Url : <JIRA_URL>:<JIRA_PORT>/rest/api/2/issue/<JIRA_ISSUE>

Body :

{
"update": {
"fixVersions": [
{"add": 
{"name": "r1.0"}
}
]
}
}

FixVersions

Req 2 To update the Status to accepted :

Url : <JIRA_URL>:<JIRA_PORT>/rest/api/2/issue/<JIRA_ISSUE>

Body :

     {
    "update": {
        "comment": [{
            "add": {
                "body": "Comment body"
            }
        }]
    },
    "fields": {},
    "transition": {
        "id": "41"
    }
}

With PUT method :

PUT METHOD - Change Status

Error :

{
    "errorMessages": [
        "Can not deserialize instance of java.util.ArrayList out of START_OBJECT token\n at [Source: com.quisapps.jira.fieldsecurity.filter.RequestWrapper$1@171c9b81; line: 3, column: 5] (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])"
    ]
}

Status Code : 400 Bad Request

With POST method :

POST METHOD - Change Status

Status Code : 204 No Content

Referred below links not useful my case :

  1. https://stackoverflow.com/questions/30809831/update-jira-ticket-status-using-rest-api#:~:text=First%2C%20execute%20'http%3A%2F%2Flocalhost,for%20%E2%80%9CDone%E2%80%9D%20is%2041.

  2. https://community.atlassian.com/t5/Jira-Software-questions/Using-REST-to-set-fixVersions/qaq-p/1642952

  3. https://community.atlassian.com/t5/Jira-questions/Error-while-trying-to-update-a-custom-field-using-REST-API/qaq-p/699080

How to deal with above issues ? Any help would be appreciated...

pruthvi
  • 43
  • 5

1 Answers1

0

I have seen set the following work (but this replaces the current value):

    {
      "update": { 
        "fixVersions": [ { "set": [ {"name": "r1.0"} ] } ]
      }
    }

I am still looking for a way to push additional values.

Tim.Burnell
  • 346
  • 1
  • 9