Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Updating a filter's column set using the REST API

J April 9, 2014

Has anyone been able to successfully update a filter's column set using the REST API?

The documentation (https://docs.atlassian.com/software/jira/docs/api/REST/latest/#d2e888) seems to be missing the representation for a PUT request.

I tried what I thought was correct:

[
  {
    "label": "Issue Type",
    "value": "issuetype"
  },
  {
    "label": "Key",
    "value": "issuekey"
  },
  {
    "label": "Summary",
    "value": "summary"
  },
  {
    "label": "Status",
    "value": "status"
  },
  {
    "label": "Fix Version/s",
    "value": "fixVersions"
  },
  {
    "label": "Priority",
    "value": "priority"
  },
  {
    "label": "Resolution",
    "value": "resolution"
  },
  {
    "label": "Created",
    "value": "created"
  },
  {
    "label": "Affects Version/s",
    "value": "versions"
  },
  {
    "label": "Cohort/Subsystem",
    "value": "customfield_12800"
  }
]

but I'm getting:

"Can not deserialize instance of com.sun.jersey.api.representation.Form out of START_ARRAY token\n at [Source: org.apache.catalina.connector.CoyoteInputStream@734be41a; line: 1, column: 1]"]}"

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Answer accepted
Dalectric
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 6, 2014

Cracked it. The JSON file needs to be in the form

{
    "columns":["issuetype","issuekey","customfield_10009","customfield_10157","summary"]
}

Took a bit of messing about to work this out. The documentation is poor in this respect as it doesn't clearly illustrate how the input file should be laid out.

Tested in v6.2.7

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 9, 2014

What are you trying to do? The PUT on filter is to update the filter. Here is a sample JSON from the docs.

{
    "name": "All Open Bugs",
    "description": "Lists all open bugs",
    "jql": "type = Bug and resolution is empty",
    "favourite": true
}

J April 9, 2014

I am trying to update the default columns on for the filter by making a PUT call to:

/rest/api/2/filter/{id}/columns

According to the link I provided, this "Sets the default columns for the given filter."

TAGS
AUG Leaders

Atlassian Community Events