I am usinf jira 6.4.x and have successfully created an app that uses the jira rest API to create issues, and to update various fields. I am having issues setting the Sprint though. It is a custom field, and via the rest/api/2/issue/xxx-nnnn/editmeta, the field has this format:
"customfield_11004":
{
"required":false,
"schema":
{
"type":"array",
"items":"string",
"custom":"com.pyxis.greenhopper.jira:gh-sprint",
"customId":11004
},
"name":"Sprint",
"operations":["set"]
}And when I pull the sprint data using a GET, the sprint is defined as:
"customfield_11004": [
"com.atlassian.greenhopper.service.sprint.Sprint@20de96ed[rapidViewId=38,state=FUTURE,name=Sprint 19,startDate=<null>,endDate=<null>,completeDate=<null>,sequence=174,id=174]"
]
So... trying to do a PUT to set the sprint, and am lost. I tried the following:
{
"update":
{
"customfield_11004": [
{
"rapidViewId": 38,
"state": "ACTIVE",
"name": "Sprint 18",
"completeDate": null,
"sequence": 173,
"id":"173"
}]
}
}But that give me an error:
{
"errorMessages": [
"Field with id' customfield_11004' and name 'Sprint' does not support operation 'id' Supported operation(s) are: 'set'"
],
"errors": {}
} I tried a "set using the following:
{
"update":
{
"customfield_11004": [
{"set" : {"rapidViewId": 38}},
{"set" : {"state": "ACTIVE"}},
{"set" : {"name": "Sprint 18"}},
{"set" : {"completeDate": null}},
{"set" : {"sequence": 173}},
{"set" : {"id": 173}}]
}
}but I get an internal server error
{
"errorMessages": [
"Internal server error"
],
"errors": {}
} What I really want to do is set just the id that is 173 in the example above.. Any ideas? TIA